From owner-svn-src-head@FreeBSD.ORG Sun May 26 02:45:49 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69C921C7; Sun, 26 May 2013 02:45:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 02BF3399; Sun, 26 May 2013 02:45:48 +0000 (UTC) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4Q2jXLx027840; Sun, 26 May 2013 12:45:33 +1000 Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4Q2jIai023179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 May 2013 12:45:21 +1000 Date: Sun, 26 May 2013 12:45:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@FreeBSD.org Subject: Re: svn commit: r250986 - head/sys/dev/usb In-Reply-To: Message-ID: <20130526122502.P847@besplex.bde.org> References: <201305251709.r4PH9xfv015285@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=sQw_kobpeVwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FG3D6h2hVzcA:10 a=6I5d2MoRAAAA:8 a=6Rb0blR-ypmRijCZwjYA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 02:45:49 -0000 On Sat, 25 May 2013 mdf@FreeBSD.org wrote: > On Sat, May 25, 2013 at 10:09 AM, Hans Petter Selasky > wrote: >> ... >> Log: >> Fix some statical clang analyzer warnings. >> ... >> ============================================================================== >> --- head/sys/dev/usb/usb_msctest.c Sat May 25 16:58:12 2013 >> (r250985) >> +++ head/sys/dev/usb/usb_msctest.c Sat May 25 17:09:58 2013 >> (r250986) >> @@ -802,7 +802,6 @@ usb_msc_eject(struct usb_device *udev, u >> if (sc == NULL) >> return (USB_ERR_INVAL); >> >> - err = 0; >> switch (method) { >> case MSC_EJECT_STOPUNIT: >> err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, >> @@ -844,6 +843,7 @@ usb_msc_eject(struct usb_device *udev, u >> break; >> default: >> DPRINTF("Unknown eject method (%d)\n", method); >> + err = 0; >> break; >> } >> DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); >> > > I don't know about the top one, but the bottom two are the safer way to > code, and should not have been changed. Unless we feel guaranteed the > compiler can detect all uninitialized use and will break the build, an > early initialization to a sane value is absolutely the right thing to do, > even if it will be overwritten. If the compiler feels sure the > initialization isn't needed, it does not have to emit the code. But any > coding change after the (missing) initialization can create a bug now > (well, it depends on how the code is structured, but from the three lines > of context svn diff provides it's not clear a bug couldn't easily be > introduced). No, initializing a variable early to a sane value obfuscates the code and makes it impossible for the compiler to detect that the variable is not properly intialized. Initializing early to an insane value that will be overwritten in all cases is not so bad. This makes it clear to human readers that the initial value should not be used, and gives runtime errors if it is used (best an immediate trap), but still prevents the compiler detecting that the variable is not properly initialized. Hmm, it would be useful to have a compiler flag for initializing all local variables to trap representations on entry to functions. This gives the runtime check in addition to the compiler check, without writing huge code to initialize all the variables. Then early initialization would break to sane values would break this feature. Of course, in practical code, you often reuse a variable without uninitializing it (by setting it to an insane value) after each of its uses becomes dead. Then you lose the compiler check. If the uses are unrelated, then it is a style bug (optimization for 30 year old compilers with no lifetime analysis) to use the same variable for them all. Otherwise, it is too painful to uninitialize variables or use block scope for them to make their lifetimes more obvious to all readers. One exception is when pointer variables are set to NULL after they are freed even when the pointers are not expected to be reused. This is done mainly for non-local variables. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 26 08:25:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0DD912B0; Sun, 26 May 2013 08:25:27 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE19E17; Sun, 26 May 2013 08:25:26 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id m17so4059478vca.16 for ; Sun, 26 May 2013 01:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=GQQ27jolNAcWW3cB266oOnWa7/58CONd9dDhOWBRhwM=; b=GLG4XHsYOt0t2cK4KX91FlpbKPks6sqB6ADbUnUi3ehHGAMy+Z81o0rldVs6xPvElp HunGDSl5oncb+R7/OViJnnMVJ9R1fYmcsGGT7noz5KGHpU/tKSpnhFYp5QmGbYxW8dmd 9omaDG0sl337GJthFX36d/Uwo1XDIpmnGFH1bK03SAEnKETaol/Be9cRsUCmfHCBLU9P +mTb3O4UioqteA236dwwqkRAgXYwNBS8W+lIkz7lewiipOcafjKynF1SDQRjxHqZY+3B WWrupxKY4KA5yoTxHNTxH/NxFaZEGySf3QZhxKB6A770JU7MZp44MZ3cdpcnONa2J/Ci UCuA== MIME-Version: 1.0 X-Received: by 10.220.223.202 with SMTP id il10mr12735700vcb.4.1369556719517; Sun, 26 May 2013 01:25:19 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Sun, 26 May 2013 01:25:19 -0700 (PDT) In-Reply-To: <20130525195659.GB26980@stack.nl> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> <20130525195659.GB26980@stack.nl> Date: Sun, 26 May 2013 10:25:19 +0200 X-Google-Sender-Auth: MpTAdsO2_8018T3bDoO_5JFvyCs Message-ID: Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale From: Ed Schouten To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gabor@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 08:25:27 -0000 Hi Jilles, 2013/5/25 Jilles Tjoelker : > It seems better to implement c16rtomb_l() and mbrtoc16_l() in the same > way, rather than duplicating the UTF-16 coding and passing a pointer to > a mbstate_t which actually has only 120 bytes of storage rather than the > required 128 bytes. Done! Could you please take another look? http://80386.nl/pub/uchar-iconv.txt (refresh!) Thanks, -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Sun May 26 09:25:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C62AFDA; Sun, 26 May 2013 09:25:15 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA50FBA; Sun, 26 May 2013 09:25:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4Q9PEDB047753; Sun, 26 May 2013 09:25:14 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4Q9PE5T047752; Sun, 26 May 2013 09:25:14 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201305260925.r4Q9PE5T047752@svn.freebsd.org> From: Antoine Brodin Date: Sun, 26 May 2013 09:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250995 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 09:25:15 -0000 Author: antoine Date: Sun May 26 09:25:14 2013 New Revision: 250995 URL: http://svnweb.freebsd.org/changeset/base/250995 Log: Move libmd.so.5 to the proper place and add missing lib32 entry. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun May 26 03:48:40 2013 (r250994) +++ head/ObsoleteFiles.inc Sun May 26 09:25:14 2013 (r250995) @@ -257,7 +257,9 @@ OLD_FILES+=usr/share/man/man1/yyfix.1.gz # 20120505: new clang import installed a redundant internal header OLD_FILES+=usr/include/clang/3.1/stdalign.h # 20120428: MD2 removed from libmd +OLD_LIBS+=lib/libmd.so.5 OLD_FILES+=usr/include/md2.h +OLD_LIBS+=usr/lib32/libmd.so.5 OLD_FILES+=usr/share/man/man3/MD2Data.3.gz OLD_FILES+=usr/share/man/man3/MD2End.3.gz OLD_FILES+=usr/share/man/man3/MD2File.3.gz @@ -824,7 +826,6 @@ OLD_LIBS+=lib/libipx.so.4 OLD_LIBS+=lib/libkiconv.so.3 OLD_LIBS+=lib/libkvm.so.4 OLD_LIBS+=lib/libmd.so.4 -OLD_LIBS+=lib/libmd.so.5 OLD_LIBS+=lib/libncurses.so.7 OLD_LIBS+=lib/libncursesw.so.7 OLD_LIBS+=lib/libnvpair.so.1 From owner-svn-src-head@FreeBSD.ORG Sun May 26 11:03:36 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A008910; Sun, 26 May 2013 11:03:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id D0278224; Sun, 26 May 2013 11:03:35 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r4QB3NvA031023 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 26 May 2013 11:03:25 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250986 - head/sys/dev/usb From: David Chisnall In-Reply-To: <20130526122502.P847@besplex.bde.org> Date: Sun, 26 May 2013 12:02:09 +0100 Content-Transfer-Encoding: 7bit Message-Id: <9848640B-3442-45E5-A59E-FFFABA992CB1@FreeBSD.org> References: <201305251709.r4PH9xfv015285@svn.freebsd.org> <20130526122502.P847@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1503) Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 11:03:36 -0000 On 26 May 2013, at 03:45, Bruce Evans wrote: > Hmm, it would be useful to have a compiler flag for initializing all > local variables to trap representations on entry to functions. The clang memory sanitizer does this. David From owner-svn-src-head@FreeBSD.ORG Sun May 26 14:14:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B19A6A16; Sun, 26 May 2013 14:14:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3E3D9E1; Sun, 26 May 2013 14:14:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEEgYG041908; Sun, 26 May 2013 14:14:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEEgC3041907; Sun, 26 May 2013 14:14:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305261414.r4QEEgC3041907@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 May 2013 14:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250997 - head/contrib/llvm/lib/Transforms/Vectorize X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 14:14:42 -0000 Author: dim Date: Sun May 26 14:14:42 2013 New Revision: 250997 URL: http://svnweb.freebsd.org/changeset/base/250997 Log: Pull in r182656 from upstream llvm trunk: LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases. Fixes PR16139. This should fix clang assertion failures when optimizing at -O3, similar to: Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"), function canVectorize, file contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171. Reported by: O. Hartmann PR: ports/178332, ports/178977 MFC after: 3 days Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 26 12:36:56 2013 (r250996) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun May 26 14:14:42 2013 (r250997) @@ -2169,7 +2169,10 @@ bool LoopVectorizationLegality::canVecto } bool LoopVectorizationLegality::canVectorize() { - assert(TheLoop->getLoopPreheader() && "No preheader!!"); + // We must have a loop in canonical form. Loops with indirectbr in them cannot + // be canonicalized. + if (!TheLoop->getLoopPreheader()) + return false; // We can only vectorize innermost loops. if (TheLoop->getSubLoopsVector().size()) From owner-svn-src-head@FreeBSD.ORG Sun May 26 14:54:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2869BDE7; Sun, 26 May 2013 14:54:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19E5EECD; Sun, 26 May 2013 14:54:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEs6UQ055052; Sun, 26 May 2013 14:54:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEs6Oi055051; Sun, 26 May 2013 14:54:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305261454.r4QEs6Oi055051@svn.freebsd.org> From: Eitan Adler Date: Sun, 26 May 2013 14:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251000 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 14:54:07 -0000 Author: eadler Date: Sun May 26 14:54:06 2013 New Revision: 251000 URL: http://svnweb.freebsd.org/changeset/base/251000 Log: Remove backwards compat layer which was added in r71419 (in 2001). This change is not intended for MFC. Reviewed by: peter Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun May 26 14:40:23 2013 (r250999) +++ head/Makefile.inc1 Sun May 26 14:54:06 2013 (r251000) @@ -892,16 +892,11 @@ NO_KERNELOBJ= t KERNCONF=${KERNFAST} .endif .endif -.if !defined(KERNCONF) && defined(KERNEL) -KERNCONF= ${KERNEL} -KERNWARN= -.else .if ${TARGET_ARCH} == "powerpc64" KERNCONF?= GENERIC64 .else KERNCONF?= GENERIC .endif -.endif INSTKERNNAME?= kernel KERNSRCDIR?= ${.CURDIR}/sys @@ -930,12 +925,6 @@ buildkernel: @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ false .endif -.if defined(KERNWARN) - @echo "--------------------------------------------------------------" - @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" - @echo "--------------------------------------------------------------" - @sleep 3 -.endif @echo .for _kernel in ${BUILDKERNELS} @echo "--------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Sun May 26 18:58:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C747E8C; Sun, 26 May 2013 18:58:00 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1B9892; Sun, 26 May 2013 18:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIw0uT035179; Sun, 26 May 2013 18:58:00 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIw03A035178; Sun, 26 May 2013 18:58:00 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201305261858.r4QIw03A035178@svn.freebsd.org> From: Jens Schweikhardt Date: Sun, 26 May 2013 18:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251012 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 18:58:00 -0000 Author: schweikh Date: Sun May 26 18:57:59 2013 New Revision: 251012 URL: http://svnweb.freebsd.org/changeset/base/251012 Log: s/recieve/receive Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Sun May 26 18:54:50 2013 (r251011) +++ head/share/man/man4/bce.4 Sun May 26 18:57:59 2013 (r251012) @@ -212,7 +212,7 @@ Enable/Disable strict RX frame size chec .It Va hw.bce.hdr_split Enable/Disable frame header/payload splitting (default 1). .It Va hw.bce.rx_pages -Set the number of memory pages assigned to recieve packets by the driver. +Set the number of memory pages assigned to receive packets by the driver. Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). .It Va hw.bce.tx_pages From owner-svn-src-head@FreeBSD.ORG Sun May 26 20:26:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D52DB8F1 for ; Sun, 26 May 2013 20:26:51 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm18.bullet.mail.ird.yahoo.com (nm18.bullet.mail.ird.yahoo.com [77.238.189.71]) by mx1.freebsd.org (Postfix) with SMTP id A093AC24 for ; Sun, 26 May 2013 20:26:50 +0000 (UTC) Received: from [77.238.189.50] by nm18.bullet.mail.ird.yahoo.com with NNFMP; 26 May 2013 20:26:37 -0000 Received: from [46.228.39.106] by tm3.bullet.mail.ird.yahoo.com with NNFMP; 26 May 2013 20:26:36 -0000 Received: from [127.0.0.1] by smtp143.mail.ir2.yahoo.com with NNFMP; 26 May 2013 20:26:36 -0000 X-Yahoo-Newman-Id: 914099.58145.bm@smtp143.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MZirmvgVM1mIV1ZRtPxthvUb7r4Otv8YtmXwRhGdz2Fh70Y HgDQ1P_oJoMDexsXsfDZEG.6cG0xyrEjWAQF_UBTdHobwyCD.AFiLSlnepgZ SdY9pSunSn.KI_fA0qroHCz9lnfxiHT33G_3ovH5XOXd0cKec6MbdzmkFYn9 iGNb8sQxi6dzkYbAoYgTsA5D7.6hqxxfAdunznLg4BJnSPGOI97zHOBLMUUt URznp1zFmEiVwPIJoLQPgIUZKygBtjmyU93Sr5gcC_DaXzUvlAHK.UFCMe3i JL7yNquIBj79C3qmU8D34JEu38VnW44nw.alQmCHQ92snTnTfxDj7Z4koWSM U0ne.KX4ooOStr7SzYBToo2S85w3MdzlotiUPuvbowaZEE3Ll4RVyMm4RGCe KWrSmLTsh4sicPu_xhLHg.9yWIkUEiDiU_N9EhihExkRDa7KYUgJeU5QC4yD ZTw-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.26] (se@87.158.28.224 with ) by smtp143.mail.ir2.yahoo.com with SMTP; 26 May 2013 20:26:36 +0000 UTC Message-ID: <51A26FED.4020801@freebsd.org> Date: Sun, 26 May 2013 22:26:21 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r250972 - head/usr.bin/patch References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525122811.I837@besplex.bde.org> In-Reply-To: <20130525122811.I837@besplex.bde.org> X-Enigmail-Version: 1.5.1 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, Stefan Esser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 20:26:51 -0000 Am 25.05.2013 06:31, schrieb Bruce Evans: > On Fri, 24 May 2013, Stefan Esser wrote: > >> ... >> Log: >> The error handling for writes to the target file could lead to the final >> fclose() being skipped. Fix this by using boolean "&" and "|" instead of >> short-cut operators "&&" and "||". >> While here, increment the last part of the version string. The reason is >> the fixed output file selection logic in pch.c, which was committed as >> r250943, yesterday. >> >> Reviewed by: pfg >> ... >> Modified: head/usr.bin/patch/patch.c >> ============================================================================== >> >> --- head/usr.bin/patch/patch.c Fri May 24 18:28:27 2013 (r250971) >> +++ head/usr.bin/patch/patch.c Fri May 24 18:54:52 2013 (r250972) >> @@ -303,7 +303,7 @@ main(int argc, char *argv[]) >> ++fuzz <= mymaxfuzz); >> >> if (skip_rest_of_patch) { /* just got decided */ >> - if (ferror(ofp) || fclose(ofp)) { >> + if (ferror(ofp) | fclose(ofp)) { >> say("Error writing %s\n", >> TMPOUTNAME); >> error = 1; > > This is more broken than before. Now the order of operations is > indeterminate, so the behaviour is undefined if fclose(ofp) is evaluated > before ferror(ofp) (then ferror(ofp) is passed an invalid pointer). > Now even the usual case when there is no error initially is broken. Oh, I see ... Sorry, I should have noticed this myself. I had considered two more complex solutions, one with a temporary variable "result" which was set by the call to ferror and where the result of fclose was ORed in, the other with duplication of the error message and setting of error. I guess that using a temporary variable for the ferror result is better ... > Error handling is very rarely correct in utilities that use stdio. > patch at least checks for errors. The easiest way to improve it (not > just for patch) is to sprinkle fflush()es. Blindly doing voided > fflush()es before every ferror() check ensures that output gets done > and checked even if you neglect to do fclose() or check for errors in > it (provided you have enough ferror() checks). This is especially Yes, I had considered an fflush with error checking before the fclose, but thought this was unnecessary (one extra call), and that it were better to use a temporary result variable, instead. And then I erroneously removed that variable and used the boolean operators, instead ... (It's good to simplify an algorithm, but not further than required to keep it functional ;-) ). > important and especially mostly not done for stdout and stderr, since > it is best to never close these (it may be impossible to report errors > on stdout or stderr on themself, especially for stderr, but it doesn't > hurt to try, except this may inhibit more correct error handling like > logging the error to another file). > > patch/pch.c has another ferror() || fclose() that wasn't touched by this > commit. It is almost OK, since the file was just opened successfully > so ferror() on it "can't happen". But this means that the normal > broken idiom 'ferror() || fclose()' is not even wrong. I noticed that case, but did not bother to change it, since pfatal() is called immediately after a failed ferror(). This will terminate the program and thus there is no resource leak. > I think ferror() in 'ferror() || fclose()' should never be necessary > unless you actually want to keep the file open if ferror(), and then > you should normally use clearerr() in the error handling. C99 is > almost clear that fclose() must fail if ferror() was true when it was > called. It says that fclose() returns EOF iff any errors were detected, > and it would take a weaselish reading of this to not allow detection > of errors that are already present when it was called. patch might > be using 'ferror() || fclose() because it doesn't trust pre-C90 stdio. Our version of patch must only work on supported releases of FreeBSD. The ferror() before flcose() does not exist in the versions it is derived from. It was added after the code was imported from OpenBSD. > It is also a style bug to use the bitwise boolean operations for logical > boolean operations. When we need sequential evaluation, this becomes a > bug. We want sequential evaluation, and that should be written normally > using > sequence points (which are easiest to get using separate statements) if > the logical boolean operations aren't suitable. So to combine the errors > from ferror() and fclose() so as to support buggy fclose()'s, and to do > this without sprinkling ferror(), we must write something like: > > locerror = 0; > if (ferror(ofp) > locerror = 1; > if (fclose(ofp) > locerror = 1; > if (locerror) { > say("Error writing %s\n", > TMPOUTNAME); > error = 1; I had code like that, before I thought I could simplify it. It read int ret; ... ret = ferror(ofp); if (fclose(ofp) || ret) { say ... error = 1 } Another possibility (too obfuscated for my taste) is: if (ferror(ofp) { fclose(ofp); ofp = NULL; } if (ofp == NULL || fclose(ofp)) say ... error = 1 } This version does not need the temporary result variable, but uses two calls to fclose() and thus produces more code. > This is too ugly. I prefer to depend on fclose() being non-broken. > Unfortunately, fclose() seems to be broken in FreeBSD: Ughh. That might be the reason the ferror() tests were added in the FreeBSD version ... > @ #include > @ @ int > @ main(void) > @ { > @ FILE *fp; > @ @ remove("test.dat"); > @ fp = fopen("test.dat", "a"); > @ fclose(fp); > @ fp = fopen("test.dat", "r"); > @ (void)fwrite("", 1, 1, fp); > @ fprintf(stderr, "ferror %d\n", ferror(fp)); > @ fprintf(stderr, "fclose %d\n", fclose(fp)); > @ return (0); > @ } > > This finds ferror(), but then fclose() succeeds. Setting ferror() without > having any real i/o problems isn't easy, and this example is contrived > since the file is only open for input, so fclose() cannot have any buffered > output to flush. However, there points to a general problem with ferror() -- > the error flag is shared between input and output, so if fclose() always > checked the flag and failed if it is set, then its failure wouldn't be > useful for detecting output errors. Neither would ferror(). So if the > stream is open for both reading and writing, the application should do > something like clearerr() before all fflush() and fclose() operations so > as to detect only write errors. fclose() in FreeBSD doesn't seem to check > the flag at all. I can't see exactly what it does. The low level function > __sflush() mainly tries to write all buffered i/o. It sets ferror() and > returns an error if any of the writes fails, but it doesn't return an error > if ferror() is already true. Do we have compatibility and/or regression tests for stdio that cover ferror/fflush/fclose? I'm wondering, whether we could just implicitly call fflush before fclose and return an error condition, if the fflush failed. That way, fclose would report write errors only reported by fflush, now. The fclose(3) man-page states: ERRORS The fclose() function may also fail and set errno for any of the errors specified for the routines close(2) or fflush(3). So, returning fflush errors from fclose is documented behavior, but apparently not implemented behavior. One way to test write errors is via tmpfs: # mount -t tmpfs -o maxfilesize=1 tmp /mnt A few more tests with this special file system: ----------------------------------------------------------------- #include int main(void) { FILE *fp; remove("test.dat"); fprintf(stderr, "1) normal write - expect OK:\n"); fp = fopen("test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("a\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n2) write 1 byte - expect OK:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n3) write 1 byte - expect OK:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w+"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n4) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n5) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n6) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n7) write 3 bytes - expect FAIL:\n"); remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "w"); fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); // fprintf(stderr, "\n8) write 1 bytes to R/O file - expect FAIL:\n"); //remove("/mnt/test.dat"); fp = fopen("/mnt/test.dat", "r"); fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fflush %d\n", fflush(fp)); fprintf(stderr, "ferror %d\n", ferror(fp)); fprintf(stderr, "fclose %d\n", fclose(fp)); return (0); } ----------------------------------------------------------------- 1) normal write - expect OK: fwrite 3 ferror 0 fflush 0 fclose 0 2) write 1 byte - expect OK: fwrite 1 ferror 0 fflush 0 ferror 0 fclose 0 3) write 1 byte - expect OK: fwrite 1 ferror 0 fflush 0 ferror 0 fclose 0 4) write 3 bytes - expect FAIL: fwrite 3 fclose -1 5) write 3 bytes - expect FAIL: fwrite 3 fflush -1 fclose 0 6) write 3 bytes - expect FAIL: fwrite 3 ferror 0 fclose -1 7) write 3 bytes - expect FAIL: fwrite 3 ferror 0 fflush -1 ferror 1 fclose 0 8) write 1 bytes to R/O file - expect FAIL: fwrite 0 ferror 1 fflush -1 ferror 1 fclose 0 ----------------------------------------------------------------- So it seems that fclose will return an error if data could not be written (see case 4), but not if an fflush already returned the error condition. It is not sticky. So I guess it is sufficient to check the result returned by fclose, without the prior check of ferror. I do not see what cases ferror can catch, that are no caught by fclose ... Regards, STefan From owner-svn-src-head@FreeBSD.ORG Sun May 26 21:48:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0B687E8; Sun, 26 May 2013 21:48:40 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BB20BEF7; Sun, 26 May 2013 21:48:40 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id B4746204; Sun, 26 May 2013 23:44:25 +0200 (CEST) Date: Sun, 26 May 2013 23:51:25 +0200 From: Pawel Jakub Dawidek To: Glen Barber Subject: Re: svn commit: r250972 - head/usr.bin/patch Message-ID: <20130526215125.GC1381@garage.freebsd.pl> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525051127.GP1756@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7gGkHNMELEOhSGF6" Content-Disposition: inline In-Reply-To: <20130525051127.GP1756@glenbarber.us> X-OS: 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, Stefan Esser , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 21:48:41 -0000 --7gGkHNMELEOhSGF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 25, 2013 at 01:11:27AM -0400, Glen Barber wrote: > On Fri, May 24, 2013 at 06:54:52PM +0000, Stefan Esser wrote: > > Author: se > > Date: Fri May 24 18:54:52 2013 > > New Revision: 250972 > > URL: http://svnweb.freebsd.org/changeset/base/250972 > >=20 >=20 > > [...] >=20 > > @@ -977,7 +977,7 @@ spew_output(void) > > #endif > > if (input_lines) > > copy_till(input_lines, true); /* dump remainder of file */ > > - rv =3D ferror(ofp) =3D=3D 0 && fclose(ofp) =3D=3D 0; > > + rv =3D ferror(ofp) =3D=3D 0 & fclose(ofp) =3D=3D 0; > > ofp =3D NULL; > > return rv; > > } > >=20 >=20 > This breaks head/. Not to mention that it is really ugly and without any comment it looks like a typo. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --7gGkHNMELEOhSGF6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGig90ACgkQForvXbEpPzRpnQCfd2ouzLBvqchMOT3sZ5z4iGbq INsAn0KWj1LFfJkqLSW2bdrmAC1SeHdl =etOR -----END PGP SIGNATURE----- --7gGkHNMELEOhSGF6-- From owner-svn-src-head@FreeBSD.ORG Sun May 26 22:11:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 70F44B08; Sun, 26 May 2013 22:11:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47561F5A; Sun, 26 May 2013 22:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QMBERY099731; Sun, 26 May 2013 22:11:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QMBDkv099729; Sun, 26 May 2013 22:11:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305262211.r4QMBDkv099729@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 26 May 2013 22:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251013 - head/sys/dev/aacraid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 22:11:14 -0000 Author: marcel Date: Sun May 26 22:11:13 2013 New Revision: 251013 URL: http://svnweb.freebsd.org/changeset/base/251013 Log: Unbreak ia64 tinderbox: 64-bit support was made conditional upon __amd64__, and thus limited. Eliminate 2 trivial conditionals by casting the 64-bit integral, holding an address, via (uintptr_t) to (void *) and replace the last remaining check for __amd64__ with a check for __LP64__ instead. Modified: head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sun May 26 18:57:59 2013 (r251012) +++ head/sys/dev/aacraid/aacraid.c Sun May 26 22:11:13 2013 (r251013) @@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc srb_sg_address = (u_int64_t)sgp->SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { -#ifdef __amd64__ +#ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; srb_sg_bytecount = sgp->SgByteCount; @@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc cm->cm_flags |= AAC_CMD_DATAOUT; if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { - if ((error = copyin( -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyin((void *)(uintptr_t)srb_sg_address, cm->cm_data, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() alloc. mem.? */ @@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc /* copy data */ if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) { - if ((error = copyout(cm->cm_data, -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyout(cm->cm_data, + (void *)(uintptr_t)srb_sg_address, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() allocated mem.? */ From owner-svn-src-head@FreeBSD.ORG Sun May 26 22:23:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7A1FECC; Sun, 26 May 2013 22:23:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A99E2FA2; Sun, 26 May 2013 22:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QMNesW003588; Sun, 26 May 2013 22:23:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QMNefL003583; Sun, 26 May 2013 22:23:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305262223.r4QMNefL003583@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 May 2013 22:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251014 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 26 May 2013 22:23:40 -0000 Author: adrian Date: Sun May 26 22:23:39 2013 New Revision: 251014 URL: http://svnweb.freebsd.org/changeset/base/251014 Log: Migrate ath(4) to now use if_transmit instead of the legacy if_start and if queue mechanism; also fix up (non-11n) TX fragment handling. This may result in a bit of a performance drop for now but I plan on debugging and resolving this at a later stage. Whilst here, fix the transmit path so fragment transmission works. The TX fragmentation handling is a bit more special. In order to correctly transmit TX fragments, there's a bunch of corner cases that need to be handled: * They must be transmitted back to back, in the same order.. * .. ie, you need to hold the TX lock whilst transmitting this set of fragments rather than interleaving it with other MSDUs destined to other nodes; * The length of the next fragment is required when transmitting, in order to correctly set the NAV field in the current frame to the length of the next frame; which requires .. * .. that we know the transmit duration of the next frame, which .. * .. requires us to set the rate of all fragments to the same length, or make the decision up-front, etc. To facilitate this, I've added a new ath_buf field to describe the length of the next fragment. This avoids having to keep the mbuf chain together. This used to work before my 11n TX path work because the ath_tx_start() routine would be handed a single mbuf with m_nextpkt pointing to the next frame, and that would be maintained all the way up to when the duration calculation was done. This doesn't hold true any longer - the actual queuing may occur at any point in the future (think ath_node TID software queuing) so this information needs to be maintained. Right now this does work for non-11n frames but it doesn't at all enforce the same rate control decision for all frames in the fragment. I plan on fixing this in a followup commit. RTS/CTS has the same issue, I'll look at fixing this in a subsequent commit. Finaly, 11n fragment support requires the driver to have fully decided what the rate scenario setup is - including 20/40MHz, short/long GI, STBC, LDPC, number of streams, etc. Right now that decision is (currently) made _after_ the NAV field value is updated. I'll fix all of this in subsequent commits. Tested: * AR5416, STA, transmitting 11abg fragments * AR5416, STA, 11n fragments work but the NAV field is incorrect for the reasons above. TODO: * It would be nice to be able to queue mbufs per-node and per-TID so we can only queue ath_buf entries when it's time to assemble frames to send to the hardware. But honestly, we should just do that level of software queue management in net80211 rather than ath(4), so I'm going to leave this alone for now. * More thorough AP, mesh and adhoc testing. * Ensure that net80211 doesn't hand us fragmented frames when A-MPDU has been negotiated, as we can't do software retransmission of fragments. * .. set CLRDMASK when transmitting fragments, just to ensure. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath.c Sun May 26 22:23:39 2013 (r251014) @@ -152,7 +152,8 @@ static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static void ath_start_queue(struct ifnet *ifp); +static int ath_transmit(struct ifnet *ifp, struct mbuf *m); +static void ath_qflush(struct ifnet *ifp); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); static int ath_ioctl(struct ifnet *, u_long, caddr_t); @@ -437,9 +438,6 @@ ath_attach(u_int16_t devid, struct ath_s TASK_INIT(&sc->sc_txqtask, 0, ath_txq_sched_tasklet, sc); TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc); - /* XXX make this a higher priority taskqueue? */ - TASK_INIT(&sc->sc_txpkttask, 0, ath_start_task, sc); - /* * Allocate hardware transmit queues: one queue for * beacon frames and one data queue for each QoS @@ -558,7 +556,8 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_start = ath_start_queue; + ifp->if_transmit = ath_transmit; + ifp->if_qflush = ath_qflush; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -2645,43 +2644,32 @@ ath_getbuf(struct ath_softc *sc, ath_buf } static void -ath_start_queue(struct ifnet *ifp) +ath_qflush(struct ifnet *ifp) { - struct ath_softc *sc = ifp->if_softc; - - ATH_PCU_LOCK(sc); - if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, - "%s: sc_inreset_cnt > 0; bailing\n", __func__); - ATH_PCU_UNLOCK(sc); - IF_LOCK(&ifp->if_snd); - sc->sc_stats.ast_tx_qstop++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); - return; - } - sc->sc_txstart_cnt++; - ATH_PCU_UNLOCK(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: start"); - ath_tx_kick(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: finished"); - - ATH_PCU_LOCK(sc); - sc->sc_txstart_cnt--; - ATH_PCU_UNLOCK(sc); + /* XXX TODO */ } -void -ath_start_task(void *arg, int npending) +/* + * Transmit a single frame. + * + * net80211 will free the node reference if the transmit + * fails, so don't free the node reference here. + */ +static int +ath_transmit(struct ifnet *ifp, struct mbuf *m) { - struct ath_softc *sc = (struct ath_softc *) arg; - struct ifnet *ifp = sc->sc_ifp; - - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: start"); + struct ieee80211com *ic = ifp->if_l2com; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211_node *ni; + struct mbuf *next; + struct ath_buf *bf; + ath_bufhead frags; + int retval = 0; - /* XXX is it ok to hold the ATH_LOCK here? */ + /* + * Tell the reset path that we're currently transmitting. + */ ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { device_printf(sc->sc_dev, @@ -2692,211 +2680,249 @@ ath_start_task(void *arg, int npending) ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); - return; + return (ENOBUFS); /* XXX should be EINVAL or? */ } sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: start"); + /* + * Grab the TX lock - it's ok to do this here; we haven't + * yet started transmitting. + */ ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); - - ATH_PCU_LOCK(sc); - sc->sc_txstart_cnt--; - ATH_PCU_UNLOCK(sc); - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: finished"); -} -void -ath_start(struct ifnet *ifp) -{ - struct ath_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; - struct ath_buf *bf; - struct mbuf *m, *next; - ath_bufhead frags; - int npkts = 0; + /* + * Node reference, if there's one. + */ + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) - return; + /* + * Enforce how deep a node queue can get. + * + * XXX it would be nicer if we kept an mbuf queue per + * node and only whacked them into ath_bufs when we + * are ready to schedule some traffic from them. + * .. that may come later. + * + * XXX we should also track the per-node hardware queue + * depth so it is easy to limit the _SUM_ of the swq and + * hwq frames. Since we only schedule two HWQ frames + * at a time, this should be OK for now. + */ + if ((!(m->m_flags & M_EAPOL)) && + (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { + sc->sc_stats.ast_tx_nodeq_overflow++; + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - ATH_TX_LOCK_ASSERT(sc); + /* + * Check how many TX buffers are available. + * + * If this is for non-EAPOL traffic, just leave some + * space free in order for buffer cloning and raw + * frame transmission to occur. + * + * If it's for EAPOL traffic, ignore this for now. + * Management traffic will be sent via the raw transmit + * method which bypasses this check. + * + * This is needed to ensure that EAPOL frames during + * (re) keying have a chance to go out. + * + * See kern/138379 for more information. + */ + if ((!(m->m_flags & M_EAPOL)) && + (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { + sc->sc_stats.ast_tx_nobuf++; + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start: called"); + /* + * Grab a TX buffer and associated resources. + * + * If it's an EAPOL frame, allocate a MGMT ath_buf. + * That way even with temporary buffer exhaustion due to + * the data path doesn't leave us without the ability + * to transmit management frames. + * + * Otherwise allocate a normal buffer. + */ + if (m->m_flags & M_EAPOL) + bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); + else + bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - for (;;) { + if (bf == NULL) { /* - * Grab the frame that we're going to try and transmit. + * If we failed to allocate a buffer, fail. + * + * We shouldn't fail normally, due to the check + * above. */ - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + sc->sc_stats.ast_tx_nobuf++; + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + m_freem(m); + m = NULL; + retval = ENOBUFS; + goto finish; + } - /* - * Enforce how deep a node queue can get. - * - * XXX it would be nicer if we kept an mbuf queue per - * node and only whacked them into ath_bufs when we - * are ready to schedule some traffic from them. - * .. that may come later. - * - * XXX we should also track the per-node hardware queue - * depth so it is easy to limit the _SUM_ of the swq and - * hwq frames. Since we only schedule two HWQ frames - * at a time, this should be OK for now. - */ - if ((!(m->m_flags & M_EAPOL)) && - (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { - sc->sc_stats.ast_tx_nodeq_overflow++; - if (ni != NULL) - ieee80211_free_node(ni); - m_freem(m); - m = NULL; - continue; - } + /* + * At this point we have a buffer; so we need to free it + * if we hit any error conditions. + */ + + /* + * Check for fragmentation. If this frame + * has been broken up verify we have enough + * buffers to send all the fragments so all + * go out or none... + */ + TAILQ_INIT(&frags); + if ((m->m_flags & M_FRAG) && + !ath_txfrag_setup(sc, &frags, m, ni)) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: out of txfrag buffers\n", __func__); + sc->sc_stats.ast_tx_nofrag++; + ifp->if_oerrors++; + ath_freetx(m); + goto bad; + } + + /* + * At this point if we have any TX fragments, then we will + * have bumped the node reference once for each of those. + */ + + /* + * XXX Is there anything actually _enforcing_ that the + * fragments are being transmitted in one hit, rather than + * being interleaved with other transmissions on that + * hardware queue? + * + * The ATH TX output lock is the only thing serialising this + * right now. + */ + + /* + * Calculate the "next fragment" length field in ath_buf + * in order to let the transmit path know enough about + * what to next write to the hardware. + */ + if (m->m_flags & M_FRAG) { + struct ath_buf *fbf = bf; + struct ath_buf *n_fbf = NULL; + struct mbuf *fm = m->m_nextpkt; /* - * Check how many TX buffers are available. - * - * If this is for non-EAPOL traffic, just leave some - * space free in order for buffer cloning and raw - * frame transmission to occur. - * - * If it's for EAPOL traffic, ignore this for now. - * Management traffic will be sent via the raw transmit - * method which bypasses this check. - * - * This is needed to ensure that EAPOL frames during - * (re) keying have a chance to go out. - * - * See kern/138379 for more information. + * We need to walk the list of fragments and set + * the next size to the following buffer. + * However, the first buffer isn't in the frag + * list, so we have to do some gymnastics here. */ - if ((!(m->m_flags & M_EAPOL)) && - (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { - sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - _IF_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m = NULL; - break; + TAILQ_FOREACH(n_fbf, &frags, bf_list) { + fbf->bf_nextfraglen = fm->m_pkthdr.len; + fbf = n_fbf; + fm = fm->m_nextpkt; } + } + /* + * Bump the ifp output counter. + * + * XXX should use atomics? + */ + ifp->if_opackets++; +nextfrag: + /* + * Pass the frame to the h/w for transmission. + * Fragmented frames have each frag chained together + * with m_nextpkt. We know there are sufficient ath_buf's + * to send all the frags because of work done by + * ath_txfrag_setup. We leave m_nextpkt set while + * calling ath_tx_start so it can use it to extend the + * the tx duration to cover the subsequent frag and + * so it can reclaim all the mbufs in case of an error; + * ath_tx_start clears m_nextpkt once it commits to + * handing the frame to the hardware. + * + * Note: if this fails, then the mbufs are freed but + * not the node reference. + */ + next = m->m_nextpkt; + if (ath_tx_start(sc, ni, bf, m)) { +bad: + ifp->if_oerrors++; +reclaim: + bf->bf_m = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK(sc); + ath_returnbuf_head(sc, bf); /* - * Grab a TX buffer and associated resources. - * - * If it's an EAPOL frame, allocate a MGMT ath_buf. - * That way even with temporary buffer exhaustion due to - * the data path doesn't leave us without the ability - * to transmit management frames. - * - * Otherwise allocate a normal buffer. + * Free the rest of the node references and + * buffers for the fragment list. */ - if (m->m_flags & M_EAPOL) - bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); - else - bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - - if (bf == NULL) { - /* - * If we failed to allocate a buffer, prepend it - * and continue. - * - * We shouldn't fail normally, due to the check - * above. - */ - sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - _IF_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m = NULL; - break; - } + ath_txfrag_cleanup(sc, &frags, ni); + ATH_TXBUF_UNLOCK(sc); + retval = ENOBUFS; + goto finish; + } - npkts ++; + /* + * Check here if the node is in power save state. + */ + ath_tx_update_tim(sc, ni, 1); + if (next != NULL) { /* - * Check for fragmentation. If this frame - * has been broken up verify we have enough - * buffers to send all the fragments so all - * go out or none... + * Beware of state changing between frags. + * XXX check sta power-save state? */ - TAILQ_INIT(&frags); - if ((m->m_flags & M_FRAG) && - !ath_txfrag_setup(sc, &frags, m, ni)) { + if (ni->ni_vap->iv_state != IEEE80211_S_RUN) { DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: out of txfrag buffers\n", __func__); - sc->sc_stats.ast_tx_nofrag++; - ifp->if_oerrors++; - ath_freetx(m); - goto bad; - } - ifp->if_opackets++; - nextfrag: - /* - * Pass the frame to the h/w for transmission. - * Fragmented frames have each frag chained together - * with m_nextpkt. We know there are sufficient ath_buf's - * to send all the frags because of work done by - * ath_txfrag_setup. We leave m_nextpkt set while - * calling ath_tx_start so it can use it to extend the - * the tx duration to cover the subsequent frag and - * so it can reclaim all the mbufs in case of an error; - * ath_tx_start clears m_nextpkt once it commits to - * handing the frame to the hardware. - */ - next = m->m_nextpkt; - if (ath_tx_start(sc, ni, bf, m)) { - bad: - ifp->if_oerrors++; - reclaim: - bf->bf_m = NULL; - bf->bf_node = NULL; - ATH_TXBUF_LOCK(sc); - ath_returnbuf_head(sc, bf); - ath_txfrag_cleanup(sc, &frags, ni); - ATH_TXBUF_UNLOCK(sc); - /* - * XXX todo, free the node outside of - * the TX lock context! - */ - if (ni != NULL) - ieee80211_free_node(ni); - continue; + "%s: flush fragmented packet, state %s\n", + __func__, + ieee80211_state_name[ni->ni_vap->iv_state]); + /* XXX dmamap */ + ath_freetx(next); + goto reclaim; } + m = next; + bf = TAILQ_FIRST(&frags); + KASSERT(bf != NULL, ("no buf for txfrag")); + TAILQ_REMOVE(&frags, bf, bf_list); + goto nextfrag; + } - /* - * Check here if the node is in power save state. - */ - ath_tx_update_tim(sc, ni, 1); + /* + * Bump watchdog timer. + */ + sc->sc_wd_timer = 5; - if (next != NULL) { - /* - * Beware of state changing between frags. - * XXX check sta power-save state? - */ - if (ni->ni_vap->iv_state != IEEE80211_S_RUN) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: flush fragmented packet, state %s\n", - __func__, - ieee80211_state_name[ni->ni_vap->iv_state]); - /* XXX dmamap */ - ath_freetx(next); - goto reclaim; - } - m = next; - bf = TAILQ_FIRST(&frags); - KASSERT(bf != NULL, ("no buf for txfrag")); - TAILQ_REMOVE(&frags, bf, bf_list); - goto nextfrag; - } +finish: + ATH_TX_UNLOCK(sc); - sc->sc_wd_timer = 5; - } - ATH_KTR(sc, ATH_KTR_TX, 1, "ath_start: finished; npkts=%d", npkts); + /* + * Finished transmitting! + */ + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); + + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: finished"); + + return (retval); } + static int ath_media_change(struct ifnet *ifp) { Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath_misc.h Sun May 26 22:23:39 2013 (r251014) @@ -134,9 +134,7 @@ static inline void ath_tx_kick(struct ath_softc *sc) { - ATH_TX_LOCK(sc); - ath_start(sc->sc_ifp); - ATH_TX_UNLOCK(sc); + /* XXX NULL for now */ } /* Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_ath_tx.c Sun May 26 22:23:39 2013 (r251014) @@ -1154,7 +1154,6 @@ ath_tx_calc_duration(struct ath_softc *s dur = rt->info[rix].lpAckDuration; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { dur += dur; /* additional SIFS+ACK */ - KASSERT(bf->bf_m->m_nextpkt != NULL, ("no fragment")); /* * Include the size of next fragment so NAV is * updated properly. The last fragment uses only @@ -1164,9 +1163,10 @@ ath_tx_calc_duration(struct ath_softc *s * fragment is the same as the rate used by the * first fragment! */ - dur += ath_hal_computetxtime(ah, rt, - bf->bf_m->m_nextpkt->m_pkthdr.len, - rix, shortPreamble); + dur += ath_hal_computetxtime(ah, + rt, + bf->bf_nextfraglen, + rix, shortPreamble); } if (isfrag) { /* Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun May 26 22:11:13 2013 (r251013) +++ head/sys/dev/ath/if_athvar.h Sun May 26 22:23:39 2013 (r251014) @@ -225,6 +225,7 @@ struct ath_buf { bus_size_t bf_mapsize; #define ATH_MAX_SCATTER ATH_TXDESC /* max(tx,rx,beacon) desc's */ bus_dma_segment_t bf_segs[ATH_MAX_SCATTER]; + uint32_t bf_nextfraglen; /* length of next fragment */ /* Completion function to call on TX complete (fail or not) */ /* @@ -733,7 +734,6 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ - struct task sc_txpkttask; /* tx frame processing */ struct ath_descdma sc_txcompdma; /* TX EDMA completion */ struct mtx sc_txcomplock; /* TX EDMA completion lock */ From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:06:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC07D21D; Mon, 27 May 2013 00:06:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BCCFF35A; Mon, 27 May 2013 00:06:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R06OtS036837; Mon, 27 May 2013 00:06:24 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R06OjG036835; Mon, 27 May 2013 00:06:24 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270006.r4R06OjG036835@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251015 - in head/sys/arm/ti: . am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:06:24 -0000 Author: gonzo Date: Mon May 27 00:06:24 2013 New Revision: 251015 URL: http://svnweb.freebsd.org/changeset/base/251015 Log: Add clock definitions for LCD controller and PWM module Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/ti_prcm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Sun May 26 22:23:39 2013 (r251014) +++ head/sys/arm/ti/am335x/am335x_prcm.c Mon May 27 00:06:24 2013 (r251015) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) #define CM_PER_L3_CLKSTCTRL (CM_PER + 0x00C) #define CM_PER_CPGMAC0_CLKCTRL (CM_PER + 0x014) +#define CM_PER_LCDC_CLKCTRL (CM_PER + 0x018) #define CM_PER_USB0_CLKCTRL (CM_PER + 0x01C) #define CM_PER_TPTC0_CLKCTRL (CM_PER + 0x024) #define CM_PER_MMC0_CLKCTRL (CM_PER + 0x03C) @@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$"); #define CM_PER_GPIO2_CLKCTRL (CM_PER + 0x0B0) #define CM_PER_GPIO3_CLKCTRL (CM_PER + 0x0B4) #define CM_PER_TPCC_CLKCTRL (CM_PER + 0x0BC) +#define CM_PER_EPWMSS1_CLKCTRL (CM_PER + 0x0CC) +#define CM_PER_EPWMSS0_CLKCTRL (CM_PER + 0x0D4) +#define CM_PER_EPWMSS2_CLKCTRL (CM_PER + 0x0D8) #define CM_PER_L3_INSTR_CLKCTRL (CM_PER + 0x0DC) #define CM_PER_L3_CLKCTRL (CM_PER + 0x0E0) #define CM_PER_TIMER5_CLKCTRL (CM_PER + 0x0EC) @@ -90,7 +94,10 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_GPIO0_CLKCTRL (CM_WKUP + 0x008) #define CM_WKUP_CM_L3_AON_CLKSTCTRL (CM_WKUP + 0x01C) #define CM_WKUP_CM_CLKSEL_DPLL_MPU (CM_WKUP + 0x02C) +#define CM_WKUP_CM_IDLEST_DPLL_DISP (CM_WKUP + 0x048) +#define CM_WKUP_CM_CLKSEL_DPLL_DISP (CM_WKUP + 0x054) #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) +#define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) #define CM_DPLL 0x500 @@ -124,9 +131,11 @@ static int am335x_clk_generic_set_source static int am335x_clk_hsmmc_get_source_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_sysclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); +static int am335x_clk_get_arm_disp_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static void am335x_prcm_reset(void); static int am335x_clk_cpsw_activate(struct ti_clock_dev *clkdev); static int am335x_clk_musb0_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev); #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ @@ -190,6 +199,15 @@ struct ti_clock_dev ti_clk_devmap[] = { .clk_get_source_freq = NULL, }, + /* LCD controller clocks */ + { .id = LCDC_CLK, + .clk_activate = am335x_clk_lcdc_activate, + .clk_deactivate = NULL, + .clk_set_source = NULL, + .clk_accessible = NULL, + .clk_get_source_freq = am335x_clk_get_arm_disp_freq, + }, + /* DMTimer */ AM335X_GENERIC_CLOCK_DEV(DMTIMER2_CLK), AM335X_GENERIC_CLOCK_DEV(DMTIMER3_CLK), @@ -220,6 +238,11 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_MMCHS_CLOCK_DEV(MMC1_CLK), AM335X_MMCHS_CLOCK_DEV(MMC2_CLK), + /* PWMSS */ + AM335X_GENERIC_CLOCK_DEV(PWMSS0_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS1_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS2_CLK), + { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL } }; @@ -267,6 +290,11 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(MMC1_CLK, CM_PER_MMC1_CLKCTRL, 0), _CLK_DETAIL(MMC2_CLK, CM_PER_MMC1_CLKCTRL, 0), + /* PWMSS modules */ + _CLK_DETAIL(PWMSS0_CLK, CM_PER_EPWMSS0_CLKCTRL, 0), + _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0), + _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0), + { INVALID_CLK_IDENT, 0}, }; @@ -491,14 +519,15 @@ am335x_clk_get_sysclk_freq(struct ti_clo return (0); } +#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) +#define DPLL_DIV(reg) ((reg & 0x7f)+1) +#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) + static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq) { uint32_t reg; uint32_t sysclk; -#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) -#define DPLL_DIV(reg) ((reg & 0x7f)+1) -#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) reg = prcm_read_4(CM_WKUP_CM_CLKSEL_DPLL_MPU); @@ -511,6 +540,23 @@ am335x_clk_get_arm_fclk_freq(struct ti_c return(0); } +static int +am335x_clk_get_arm_disp_freq(struct ti_clock_dev *clkdev, unsigned int *freq) +{ + uint32_t reg; + uint32_t sysclk; + + reg = prcm_read_4(CM_WKUP_CM_CLKSEL_DPLL_DISP); + + /*Check if we are running in bypass */ + if (DPLL_BYP_CLKSEL(reg)) + return ENXIO; + + am335x_clk_get_sysclk_freq(NULL, &sysclk); + *freq = DPLL_MULT(reg) * (sysclk / DPLL_DIV(reg)); + return(0); +} + static void am335x_prcm_reset(void) { @@ -565,4 +611,46 @@ am335x_clk_musb0_activate(struct ti_cloc return(0); } +static int +am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev) +{ + struct am335x_prcm_softc *sc = am335x_prcm_sc; + + if (sc == NULL) + return (ENXIO); + + /* Bypass mode */ + prcm_write_4(CM_WKUP_CM_CLKMODE_DPLL_DISP, 0x4); + + /* Make sure it's in bypass mode */ + while (!(prcm_read_4(CM_WKUP_CM_IDLEST_DPLL_DISP) + & (1 << 8))) + DELAY(10); + /* + * For now set frequenct to 5xSYSFREQ + * More flexible control might be required + */ + prcm_write_4(CM_WKUP_CM_CLKSEL_DPLL_DISP, (5 << 8) | 0); + + /* Locked mode */ + prcm_write_4(CM_WKUP_CM_CLKMODE_DPLL_DISP, 0x7); + + int timeout = 10000; + while ((!(prcm_read_4(CM_WKUP_CM_IDLEST_DPLL_DISP) + & (1 << 0))) && timeout--) + DELAY(10); + + /*set MODULEMODE to ENABLE(2) */ + prcm_write_4(CM_PER_LCDC_CLKCTRL, 2); + + /* wait for MODULEMODE to become ENABLE(2) */ + while ((prcm_read_4(CM_PER_LCDC_CLKCTRL) & 0x3) != 2) + DELAY(10); + + /* wait for IDLEST to become Func(0) */ + while(prcm_read_4(CM_PER_LCDC_CLKCTRL) & (3<<16)) + DELAY(10); + + return (0); +} Modified: head/sys/arm/ti/ti_prcm.h ============================================================================== --- head/sys/arm/ti/ti_prcm.h Sun May 26 22:23:39 2013 (r251014) +++ head/sys/arm/ti/ti_prcm.h Mon May 27 00:06:24 2013 (r251015) @@ -141,6 +141,14 @@ typedef enum { EDMA_TPTC1_CLK, EDMA_TPTC2_CLK, + /* LCD controller module */ + LCDC_CLK = 1300, + + /* PWM modules */ + PWMSS0_CLK = 1400, + PWMSS1_CLK, + PWMSS2_CLK, + INVALID_CLK_IDENT } clk_ident_t; From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:09:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 335053A2; Mon, 27 May 2013 00:09:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0AEDF365; Mon, 27 May 2013 00:09:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0949D037334; Mon, 27 May 2013 00:09:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R094LB037333; Mon, 27 May 2013 00:09:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270009.r4R094LB037333@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251016 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:09:05 -0000 Author: gonzo Date: Mon May 27 00:09:04 2013 New Revision: 251016 URL: http://svnweb.freebsd.org/changeset/base/251016 Log: Add SCM registers definitions for AM335x platform Added: head/sys/arm/ti/am335x/am335x_scm.h (contents, props changed) Added: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_scm.h Mon May 27 00:09:04 2013 (r251016) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * 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 __AM335X_SCM_H__ +#define __AM335X_SCM_H__ + +/* AM335x-specific registers for control module (scm) */ +#define SCM_USB_CTRL0 0x620 +#define SCM_USB_STS0 0x624 +#define SCM_USB_CTRL1 0x628 +#define SCM_USB_STS1 0x62C +#define SCM_PWMSS_CTRL 0x664 + +#endif /* __AM335X_SCM_H__ */ From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:13:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A0676672; Mon, 27 May 2013 00:13:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80FA73E5; Mon, 27 May 2013 00:13:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0DSOR039744; Mon, 27 May 2013 00:13:28 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0DRWA039741; Mon, 27 May 2013 00:13:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270013.r4R0DRWA039741@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251017 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:13:28 -0000 Author: gonzo Date: Mon May 27 00:13:27 2013 New Revision: 251017 URL: http://svnweb.freebsd.org/changeset/base/251017 Log: Add PWM module driver for AM335x. Only eCAS subsystem is supported Export function to configure eCAS submodule from another drivers. It's used to control LCD panel backlight on AM335x EVM. Added: head/sys/arm/ti/am335x/am335x_pwm.c (contents, props changed) head/sys/arm/ti/am335x/am335x_pwm.h (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_pwm.c Mon May 27 00:13:27 2013 (r251017) @@ -0,0 +1,285 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * 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 "am335x_pwm.h" +#include "am335x_scm.h" + +#define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "am335x_pwm softc", MTX_DEF) +#define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); + +static struct resource_spec am335x_pwm_mem_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* PWMSS */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* eCAP */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* eQEP */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /*ePWM */ + { -1, 0, 0 } +}; + +#define PWMSS_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res[0], reg); +#define PWMSS_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res[0], reg, value); + +#define ECAP_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res[1], reg); +#define ECAP_WRITE2(_sc, reg, value) \ + bus_write_2((_sc)->sc_mem_res[1], reg, value); +#define ECAP_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res[1], reg); +#define ECAP_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res[1], reg, value); + +#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res[3], reg); +#define EPWM_WRITE2(_sc, reg, value) \ + bus_write_2((_sc)->sc_mem_res[3], reg, value); + +#define PWMSS_IDVER 0x00 +#define PWMSS_SYSCONFIG 0x04 +#define PWMSS_CLKCONFIG 0x08 +#define CLKCONFIG_EPWMCLK_EN (1 << 8) +#define PWMSS_CLKSTATUS 0x0C + +#define ECAP_TSCTR 0x00 +#define ECAP_CAP1 0x08 +#define ECAP_CAP2 0x0C +#define ECAP_CAP3 0x10 +#define ECAP_CAP4 0x14 +#define ECAP_ECCTL2 0x2A +#define ECCTL2_MODE_APWM (1 << 9) +#define ECCTL2_SYNCO_SEL (3 << 6) +#define ECCTL2_TSCTRSTOP_FREERUN (1 << 4) + +#define EPWM_TBCTL 0x00 +#define TBCTL_PHDIR_UP (1 << 13) +#define TBCTL_PHDIR_DOWN (0 << 13) +#define TBCTL_CLKDIV(x) ((x) << 10) +#define TBCTL_HSPCLKDIV(x) ((x) << 7) +#define TBCTL_SYNCOSEL_DISABLED (3 << 4) +#define TBCTL_PRDLD_SHADOW (0 << 3) +#define TBCTL_PRDLD_IMMEDIATE (0 << 3) +#define TBCTL_PHSEN_ENABLED (1 << 2) +#define TBCTL_PHSEN_DISABLED (0 << 2) +#define EPWM_TBSTS 0x02 +#define EPWM_TBPHSHR 0x04 +#define EPWM_TBPHS 0x06 +#define EPWM_TBCNT 0x08 +#define EPWM_TBPRD 0x0a +/* Counter-compare */ +#define EPWM_CMPCTL 0x0e +#define CMPCTL_SHDWBMODE_SHADOW (1 << 6) +#define CMPCTL_SHDWBMODE_IMMEDIATE (0 << 6) +#define CMPCTL_SHDWAMODE_SHADOW (1 << 4) +#define CMPCTL_SHDWAMODE_IMMEDIATE (0 << 4) +#define CMPCTL_LOADBMODE_ZERO (0 << 2) +#define CMPCTL_LOADBMODE_PRD (1 << 2) +#define CMPCTL_LOADBMODE_EITHER (2 << 2) +#define CMPCTL_LOADBMODE_FREEZE (3 << 2) +#define CMPCTL_LOADAMODE_ZERO (0 << 0) +#define CMPCTL_LOADAMODE_PRD (1 << 0) +#define CMPCTL_LOADAMODE_EITHER (2 << 0) +#define CMPCTL_LOADAMODE_FREEZE (3 << 0) +#define EPWM_CMPAHR 0x10 +#define EPWM_CMPA 0x12 +#define EPWM_CMPB 0x14 +/* CMPCTL_LOADAMODE_ZERO */ +#define EPWM_AQCTLA 0x16 +#define EPWM_AQCTLB 0x18 +#define AQCTL_CAU_NONE (0 << 0) +#define AQCTL_CAU_CLEAR (1 << 0) +#define AQCTL_CAU_SET (2 << 0) +#define AQCTL_CAU_TOGGLE (3 << 0) +#define AQCTL_ZRO_NONE (0 << 0) +#define AQCTL_ZRO_CLEAR (1 << 0) +#define AQCTL_ZRO_SET (2 << 0) +#define AQCTL_ZRO_TOGGLE (3 << 0) +#define EPWM_AQSFRC 0x1a +#define EPWM_AQCSFRC 0x1c + +static device_probe_t am335x_pwm_probe; +static device_attach_t am335x_pwm_attach; +static device_detach_t am335x_pwm_detach; + +struct am335x_pwm_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource *sc_mem_res[4]; + int sc_id; +}; + +static device_method_t am335x_pwm_methods[] = { + DEVMETHOD(device_probe, am335x_pwm_probe), + DEVMETHOD(device_attach, am335x_pwm_attach), + DEVMETHOD(device_detach, am335x_pwm_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_pwm_driver = { + "am335x_pwm", + am335x_pwm_methods, + sizeof(struct am335x_pwm_softc), +}; + +static devclass_t am335x_pwm_devclass; + +/* + * API function to set period/duty cycles for ECASx + */ +int +am335x_pwm_config_ecas(int unit, int period, int duty) +{ + device_t dev; + struct am335x_pwm_softc *sc; + uint16_t reg; + + dev = devclass_get_device(am335x_pwm_devclass, unit); + if (dev == NULL) + return (ENXIO); + + if (duty > period) + return (EINVAL); + + if (period == 0) + return (EINVAL); + + sc = device_get_softc(dev); + PWM_LOCK(sc); + + reg = ECAP_READ2(sc, ECAP_ECCTL2); + reg |= ECCTL2_MODE_APWM | ECCTL2_TSCTRSTOP_FREERUN | ECCTL2_SYNCO_SEL; + ECAP_WRITE2(sc, ECAP_ECCTL2, reg); + + /* CAP3 in APWM mode is APRD shadow register */ + ECAP_WRITE4(sc, ECAP_CAP3, period - 1); + + /* CAP4 in APWM mode is ACMP shadow register */ + ECAP_WRITE4(sc, ECAP_CAP4, duty); + /* Restart counter */ + ECAP_WRITE4(sc, ECAP_TSCTR, 0); + + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_pwm_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ti,am335x-pwm")) + return (ENXIO); + + device_set_desc(dev, "AM335x PWM"); + + return (BUS_PROBE_DEFAULT); +} + +static int +am335x_pwm_attach(device_t dev) +{ + struct am335x_pwm_softc *sc; + int err; + uint32_t reg; + phandle_t node; + pcell_t did; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + /* Get the PWM module id */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "pwm-device-id", &did, sizeof(did))) <= 0) { + device_printf(dev, "missing pwm-device-id attribute in FDT\n"); + return (ENXIO); + } + sc->sc_id = fdt32_to_cpu(did); + + PWM_LOCK_INIT(sc); + + err = bus_alloc_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + if (err) { + device_printf(dev, "cannot allocate memory resources\n"); + goto fail; + } + + ti_prcm_clk_enable(PWMSS0_CLK + sc->sc_id); + ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); + reg |= (1 << sc->sc_id); + ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); + + return (0); +fail: + PWM_LOCK_DESTROY(sc); + if (sc->sc_mem_res[0]) + bus_release_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + + return(ENXIO); +} + +static int +am335x_pwm_detach(device_t dev) +{ + struct am335x_pwm_softc *sc; + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + if (sc->sc_mem_res[0]) + bus_release_resources(dev, am335x_pwm_mem_spec, + sc->sc_mem_res); + PWM_UNLOCK(sc); + + PWM_LOCK_DESTROY(sc); + + return (0); +} + +DRIVER_MODULE(am335x_pwm, simplebus, am335x_pwm_driver, am335x_pwm_devclass, 0, 0); +MODULE_VERSION(am335x_pwm, 1); +MODULE_DEPEND(am335x_pwm, simplebus, 1, 1, 1); Added: head/sys/arm/ti/am335x/am335x_pwm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_pwm.h Mon May 27 00:13:27 2013 (r251017) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * 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 __AM335X_PWM_H__ +#define __AM335X_PWM_H__ + +int am335x_pwm_config_ecas(int unit, int period, int duty); + +#endif /* __AM335X_PWM_H__ */ Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Mon May 27 00:09:04 2013 (r251016) +++ head/sys/arm/ti/am335x/files.am335x Mon May 27 00:13:27 2013 (r251017) @@ -4,6 +4,7 @@ arm/ti/aintc.c standard arm/ti/am335x/am335x_prcm.c standard arm/ti/am335x/am335x_dmtimer.c standard arm/ti/am335x/am335x_scm_padconf.c standard +arm/ti/am335x/am335x_pwm.c standard arm/ti/ti_edma3.c standard arm/ti/ti_mmchs.c optional mmc arm/ti/cpsw/if_cpsw.c optional cpsw From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:23:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2899977; Mon, 27 May 2013 00:23:02 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1791650; Mon, 27 May 2013 00:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0N2mW042973; Mon, 27 May 2013 00:23:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0N2bC042969; Mon, 27 May 2013 00:23:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270023.r4R0N2bC042969@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251018 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:23:02 -0000 Author: gonzo Date: Mon May 27 00:23:01 2013 New Revision: 251018 URL: http://svnweb.freebsd.org/changeset/base/251018 Log: AM335x LCD controller driver with syscons support Limitations: - Raster mode only - 24 and 32 bpp only Added: head/sys/arm/ti/am335x/am335x_lcd.c (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd.h (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd_syscons.c (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd.c Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,667 @@ +/*- + * Copyright 2013 Oleksandr Tymoshenko + * 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 +#include +#include + +#include +#include + +#include "am335x_lcd.h" +#include "am335x_pwm.h" + +#define LCD_PID 0x00 +#define LCD_CTRL 0x04 +#define CTRL_DIV_MASK 0xff +#define CTRL_DIV_SHIFT 8 +#define CTRL_AUTO_UFLOW_RESTART (1 << 1) +#define CTRL_RASTER_MODE 1 +#define CTRL_LIDD_MODE 0 +#define LCD_LIDD_CTRL 0x0C +#define LCD_LIDD_CS0_CONF 0x10 +#define LCD_LIDD_CS0_ADDR 0x14 +#define LCD_LIDD_CS0_DATA 0x18 +#define LCD_LIDD_CS1_CONF 0x1C +#define LCD_LIDD_CS1_ADDR 0x20 +#define LCD_LIDD_CS1_DATA 0x24 +#define LCD_RASTER_CTRL 0x28 +#define RASTER_CTRL_TFT24_UNPACKED (1 << 26) +#define RASTER_CTRL_TFT24 (1 << 25) +#define RASTER_CTRL_STN565 (1 << 24) +#define RASTER_CTRL_TFTPMAP (1 << 23) +#define RASTER_CTRL_NIBMODE (1 << 22) +#define RASTER_CTRL_PALMODE_SHIFT 20 +#define PALETTE_PALETTE_AND_DATA 0x00 +#define PALETTE_PALETTE_ONLY 0x01 +#define PALETTE_DATA_ONLY 0x02 +#define RASTER_CTRL_REQDLY_SHIFT 12 +#define RASTER_CTRL_MONO8B (1 << 9) +#define RASTER_CTRL_RBORDER (1 << 8) +#define RASTER_CTRL_LCDTFT (1 << 7) +#define RASTER_CTRL_LCDBW (1 << 1) +#define RASTER_CTRL_LCDEN (1 << 0) +#define LCD_RASTER_TIMING_0 0x2C +#define RASTER_TIMING_0_HBP_SHIFT 24 +#define RASTER_TIMING_0_HFP_SHIFT 16 +#define RASTER_TIMING_0_HSW_SHIFT 10 +#define RASTER_TIMING_0_PPLLSB_SHIFT 4 +#define RASTER_TIMING_0_PPLMSB_SHIFT 3 +#define LCD_RASTER_TIMING_1 0x30 +#define RASTER_TIMING_1_VBP_SHIFT 24 +#define RASTER_TIMING_1_VFP_SHIFT 16 +#define RASTER_TIMING_1_VSW_SHIFT 10 +#define RASTER_TIMING_1_LPP_SHIFT 0 +#define LCD_RASTER_TIMING_2 0x34 +#define RASTER_TIMING_2_HSWHI_SHIFT 27 +#define RASTER_TIMING_2_LPP_B10_SHIFT 26 +#define RASTER_TIMING_2_PHSVS (1 << 25) +#define RASTER_TIMING_2_PHSVS_RISE (1 << 24) +#define RASTER_TIMING_2_PHSVS_FALL (0 << 24) +#define RASTER_TIMING_2_IOE (1 << 23) +#define RASTER_TIMING_2_IPC (1 << 22) +#define RASTER_TIMING_2_IHS (1 << 21) +#define RASTER_TIMING_2_IVS (1 << 20) +#define RASTER_TIMING_2_ACBI_SHIFT 16 +#define RASTER_TIMING_2_ACB_SHIFT 8 +#define RASTER_TIMING_2_HBPHI_SHIFT 4 +#define RASTER_TIMING_2_HFPHI_SHIFT 0 +#define LCD_RASTER_SUBPANEL 0x38 +#define LCD_RASTER_SUBPANEL2 0x3C +#define LCD_LCDDMA_CTRL 0x40 +#define LCDDMA_CTRL_DMA_MASTER_PRIO_SHIFT 16 +#define LCDDMA_CTRL_TH_FIFO_RDY_SHIFT 8 +#define LCDDMA_CTRL_BURST_SIZE_SHIFT 4 +#define LCDDMA_CTRL_BYTES_SWAP (1 << 3) +#define LCDDMA_CTRL_BE (1 << 1) +#define LCDDMA_CTRL_FB0_ONLY 0 +#define LCDDMA_CTRL_FB0_FB1 (1 << 0) +#define LCD_LCDDMA_FB0_BASE 0x44 +#define LCD_LCDDMA_FB0_CEILING 0x48 +#define LCD_LCDDMA_FB1_BASE 0x4C +#define LCD_LCDDMA_FB1_CEILING 0x50 +#define LCD_SYSCONFIG 0x54 +#define SYSCONFIG_STANDBY_FORCE (0 << 4) +#define SYSCONFIG_STANDBY_NONE (1 << 4) +#define SYSCONFIG_STANDBY_SMART (2 << 4) +#define SYSCONFIG_IDLE_FORCE (0 << 2) +#define SYSCONFIG_IDLE_NONE (1 << 2) +#define SYSCONFIG_IDLE_SMART (2 << 2) +#define LCD_IRQSTATUS_RAW 0x58 +#define LCD_IRQSTATUS 0x5C +#define LCD_IRQENABLE_SET 0x60 +#define LCD_IRQENABLE_CLEAR 0x64 +#define IRQ_EOF1 (1 << 9) +#define IRQ_EOF0 (1 << 8) +#define IRQ_PL (1 << 6) +#define IRQ_FUF (1 << 5) +#define IRQ_ACB (1 << 3) +#define IRQ_SYNC_LOST (1 << 2) +#define IRQ_RASTER_DONE (1 << 1) +#define IRQ_FRAME_DONE (1 << 0) +#define LCD_CLKC_ENABLE 0x6C +#define CLKC_ENABLE_DMA (1 << 2) +#define CLKC_ENABLE_LDID (1 << 1) +#define CLKC_ENABLE_CORE (1 << 0) +#define LCD_CLKC_RESET 0x70 +#define CLKC_RESET_MAIN (1 << 3) +#define CLKC_RESET_DMA (1 << 2) +#define CLKC_RESET_LDID (1 << 1) +#define CLKC_RESET_CORE (1 << 0) + +#define LCD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define LCD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define LCD_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "am335x_lcd", MTX_DEF) +#define LCD_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); + +#define LCD_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, reg); +#define LCD_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res, reg, value); + + +/* Backlight is controlled by eCAS interface on PWM unit 0 */ +#define PWM_UNIT 0 +#define PWM_PERIOD 100 + +struct am335x_lcd_softc { + device_t sc_dev; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + void *sc_intr_hl; + struct mtx sc_mtx; + int sc_backlight; + struct sysctl_oid *sc_oid; + + /* Framebuffer */ + bus_dma_tag_t sc_dma_tag; + bus_dmamap_t sc_dma_map; + size_t sc_fb_size; + bus_addr_t sc_fb_phys; + uint8_t *sc_fb_base; +}; + +static void +am335x_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = segs[0].ds_addr; +} + +static uint32_t +am335x_lcd_calc_divisor(uint32_t reference, uint32_t freq) +{ + uint32_t div; + /* Raster mode case: divisors are in range from 2 to 255 */ + for (div = 2; div < 255; div++) + if (reference/div <= freq) + return (div); + + return (255); +} + +static int +am335x_lcd_sysctl_backlight(SYSCTL_HANDLER_ARGS) +{ + struct am335x_lcd_softc *sc = (struct am335x_lcd_softc*)arg1; + int error; + int backlight; + + backlight = sc->sc_backlight;; + error = sysctl_handle_int(oidp, &backlight, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + if (backlight < 0) + backlight = 0; + if (backlight > 100) + backlight = 100; + + LCD_LOCK(sc); + error = am335x_pwm_config_ecas(PWM_UNIT, PWM_PERIOD, + backlight*PWM_PERIOD/100); + if (error == 0) + sc->sc_backlight = backlight; + LCD_UNLOCK(sc); + + return (error); +} + +static int +am335x_read_panel_property(device_t dev, const char *name, uint32_t *val) +{ + phandle_t node; + pcell_t cell; + + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, name, &cell, sizeof(cell))) <= 0) { + device_printf(dev, "missing '%s' attribute in LCD panel info\n", + name); + return (ENXIO); + } + + *val = fdt32_to_cpu(cell); + + return (0); +} + +static int +am335x_read_panel_info(device_t dev, struct panel_info *panel) +{ + int error; + + error = 0; + if ((error = am335x_read_panel_property(dev, + "panel_width", &panel->panel_width))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_height", &panel->panel_height))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hfp", &panel->panel_hfp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hbp", &panel->panel_hbp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_hsw", &panel->panel_hsw))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vfp", &panel->panel_vfp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vbp", &panel->panel_vbp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_vsw", &panel->panel_vsw))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_pxl_clk", &panel->panel_pxl_clk))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "panel_invert_pxl_clk", &panel->panel_invert_pxl_clk))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "ac_bias", &panel->ac_bias))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "ac_bias_intrpt", &panel->ac_bias_intrpt))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "dma_burst_sz", &panel->dma_burst_sz))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "bpp", &panel->bpp))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "fdd", &panel->fdd))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "invert_line_clock", &panel->invert_line_clock))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "invert_frm_clock", &panel->invert_frm_clock))) + goto out; + + if ((error = am335x_read_panel_property(dev, + "sync_edge", &panel->sync_edge))) + goto out; + + error = am335x_read_panel_property(dev, + "sync_ctrl", &panel->sync_ctrl); + +out: + return (error); +} + +static void +am335x_lcd_intr(void *arg) +{ + struct am335x_lcd_softc *sc = arg; + uint32_t reg; + + reg = LCD_READ4(sc, LCD_IRQSTATUS); + LCD_WRITE4(sc, LCD_IRQSTATUS, reg); + + if (reg & IRQ_SYNC_LOST) { + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg &= ~RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + return; + } + + if (reg & IRQ_PL) { + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg &= ~RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + return; + } + + if (reg & IRQ_EOF0) { + LCD_WRITE4(sc, LCD_LCDDMA_FB0_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB0_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + reg &= ~IRQ_EOF0; + } + + if (reg & IRQ_EOF1) { + LCD_WRITE4(sc, LCD_LCDDMA_FB1_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + reg &= ~IRQ_EOF1; + } + + if (reg & IRQ_FUF) { + /* TODO: Handle FUF */ + } + + if (reg & IRQ_ACB) { + /* TODO: Handle ACB */ + } +} + +static int +am335x_lcd_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) + return (ENXIO); + + device_set_desc(dev, "AM335x LCD controller"); + + return (0); +} + +static int +am335x_lcd_attach(device_t dev) +{ + struct am335x_lcd_softc *sc; + int rid; + int div; + struct panel_info panel; + uint32_t reg, timing0, timing1, timing2; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + uint32_t burst_log; + int err; + size_t dma_size; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + if (am335x_read_panel_info(dev, &panel)) + return (ENXIO); + + int ref_freq = 0; + ti_prcm_clk_enable(LCDC_CLK); + if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { + device_printf(dev, "Can't get reference frequency\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, am335x_lcd_intr, sc, + &sc->sc_intr_hl) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->sc_mem_res); + device_printf(dev, "Unable to setup the irq handler.\n"); + return (ENXIO); + } + + LCD_LOCK_INIT(sc); + + /* Panle initialization */ + dma_size = round_page(panel.panel_width*panel.panel_height*panel.bpp/8); + + /* + * Now allocate framebuffer memory + */ + err = bus_dma_tag_create( + bus_get_dma_tag(dev), + 4, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + dma_size, 1, /* maxsize, nsegments */ + dma_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->sc_dma_tag); + if (err) + goto fail; + + err = bus_dmamem_alloc(sc->sc_dma_tag, (void **)&sc->sc_fb_base, + 0, &sc->sc_dma_map); + + if (err) { + device_printf(dev, "cannot allocate framebuffer\n"); + goto fail; + } + + err = bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, sc->sc_fb_base, + dma_size, am335x_fb_dmamap_cb, &sc->sc_fb_phys, BUS_DMA_NOWAIT); + + if (err) { + device_printf(dev, "cannot load DMA map\n"); + goto fail; + } + + /* Make sure it's blank */ + memset(sc->sc_fb_base, 0x00, dma_size); + + /* Calculate actual FB Size */ + sc->sc_fb_size = panel.panel_width*panel.panel_height*panel.bpp/8; + + /* Only raster mode is supported */ + reg = CTRL_RASTER_MODE; + div = am335x_lcd_calc_divisor(ref_freq, panel.panel_pxl_clk); + reg |= (div << CTRL_DIV_SHIFT); + LCD_WRITE4(sc, LCD_CTRL, reg); + + /* Set timing */ + timing0 = timing1 = timing2 = 0; + + /* Horizontal back porch */ + timing0 |= (panel.panel_hbp & 0xff) << RASTER_TIMING_0_HBP_SHIFT; + timing2 |= ((panel.panel_hbp >> 8) & 3) << RASTER_TIMING_2_HBPHI_SHIFT; + /* Horizontal front porch */ + timing0 |= (panel.panel_hfp & 0xff) << RASTER_TIMING_0_HFP_SHIFT; + timing2 |= ((panel.panel_hfp >> 8) & 3) << RASTER_TIMING_2_HFPHI_SHIFT; + /* Horizontal sync width */ + timing0 |= (panel.panel_hsw & 0x3f) << RASTER_TIMING_0_HSW_SHIFT; + timing2 |= ((panel.panel_hsw >> 6) & 0xf) << RASTER_TIMING_2_HSWHI_SHIFT; + + /* Vertical back porch, front porch, sync width */ + timing1 |= (panel.panel_vbp & 0xff) << RASTER_TIMING_1_VBP_SHIFT; + timing1 |= (panel.panel_vfp & 0xff) << RASTER_TIMING_1_VFP_SHIFT; + timing1 |= (panel.panel_vsw & 0x3f) << RASTER_TIMING_1_VSW_SHIFT; + + /* Pixels per line */ + timing0 |= (((panel.panel_width - 1) >> 10) & 1) + << RASTER_TIMING_0_PPLMSB_SHIFT; + timing0 |= (((panel.panel_width - 1) >> 4) & 0x3f) + << RASTER_TIMING_0_PPLLSB_SHIFT; + + /* Lines per panel */ + timing1 |= ((panel.panel_height - 1) & 0x3ff) + << RASTER_TIMING_1_LPP_SHIFT; + timing2 |= (((panel.panel_height - 1) >> 10 ) & 1) + << RASTER_TIMING_2_LPP_B10_SHIFT; + + /* clock signal settings */ + if (panel.sync_ctrl) + timing2 |= RASTER_TIMING_2_PHSVS; + if (panel.sync_edge) + timing2 |= RASTER_TIMING_2_PHSVS_RISE; + else + timing2 |= RASTER_TIMING_2_PHSVS_FALL; + if (panel.invert_line_clock) + timing2 |= RASTER_TIMING_2_IHS; + if (panel.invert_frm_clock) + timing2 |= RASTER_TIMING_2_IVS; + if (panel.panel_invert_pxl_clk) + timing2 |= RASTER_TIMING_2_IPC; + + /* AC bias */ + timing2 |= (panel.ac_bias << RASTER_TIMING_2_ACB_SHIFT); + timing2 |= (panel.ac_bias_intrpt << RASTER_TIMING_2_ACBI_SHIFT); + + LCD_WRITE4(sc, LCD_RASTER_TIMING_0, timing0); + LCD_WRITE4(sc, LCD_RASTER_TIMING_1, timing1); + LCD_WRITE4(sc, LCD_RASTER_TIMING_2, timing2); + + /* DMA settings */ + reg = LCDDMA_CTRL_FB0_FB1; + /* Find power of 2 for current burst size */ + switch (panel.dma_burst_sz) { + case 1: + burst_log = 0; + break; + case 2: + burst_log = 1; + break; + case 4: + burst_log = 2; + break; + case 8: + burst_log = 3; + break; + case 16: + default: + burst_log = 4; + break; + } + reg |= (burst_log << LCDDMA_CTRL_BURST_SIZE_SHIFT); + /* XXX: FIFO TH */ + reg |= (0 << LCDDMA_CTRL_TH_FIFO_RDY_SHIFT); + LCD_WRITE4(sc, LCD_LCDDMA_CTRL, reg); + + LCD_WRITE4(sc, LCD_LCDDMA_FB0_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB0_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_BASE, sc->sc_fb_phys); + LCD_WRITE4(sc, LCD_LCDDMA_FB1_CEILING, sc->sc_fb_phys + sc->sc_fb_size - 1); + + /* Enable LCD */ + reg = RASTER_CTRL_LCDTFT; + reg |= (panel.fdd << RASTER_CTRL_REQDLY_SHIFT); + reg |= (PALETTE_DATA_ONLY << RASTER_CTRL_PALMODE_SHIFT); + if (panel.bpp >= 24) + reg |= RASTER_CTRL_TFT24; + if (panel.bpp == 32) + reg |= RASTER_CTRL_TFT24_UNPACKED; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + LCD_WRITE4(sc, LCD_CLKC_ENABLE, + CLKC_ENABLE_DMA | CLKC_ENABLE_LDID | CLKC_ENABLE_CORE); + + LCD_WRITE4(sc, LCD_CLKC_RESET, CLKC_RESET_MAIN); + DELAY(100); + LCD_WRITE4(sc, LCD_CLKC_RESET, 0); + + reg = IRQ_EOF1 | IRQ_EOF0 | IRQ_FUF | IRQ_PL | + IRQ_ACB | IRQ_SYNC_LOST | IRQ_RASTER_DONE | + IRQ_FRAME_DONE; + LCD_WRITE4(sc, LCD_IRQENABLE_SET, reg); + + reg = LCD_READ4(sc, LCD_RASTER_CTRL); + reg |= RASTER_CTRL_LCDEN; + LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); + + LCD_WRITE4(sc, LCD_SYSCONFIG, + SYSCONFIG_STANDBY_SMART | SYSCONFIG_IDLE_SMART); + + /* Init backlight interface */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree = device_get_sysctl_tree(sc->sc_dev); + sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "backlight", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_lcd_sysctl_backlight, "I", "LCD backlight"); + sc->sc_backlight = 0; + /* Check if eCAS interface is available at this point */ + if (am335x_pwm_config_ecas(PWM_UNIT, + PWM_PERIOD, PWM_PERIOD) == 0) + sc->sc_backlight = 100; + + am335x_lcd_syscons_setup((vm_offset_t)sc->sc_fb_base, sc->sc_fb_phys, &panel); + + return (0); + +fail: + return (err); +} + +static int +am335x_lcd_detach(device_t dev) +{ + /* Do not let unload driver */ + return (EBUSY); +} + +static device_method_t am335x_lcd_methods[] = { + DEVMETHOD(device_probe, am335x_lcd_probe), + DEVMETHOD(device_attach, am335x_lcd_attach), + DEVMETHOD(device_detach, am335x_lcd_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_lcd_driver = { + "am335x_lcd", + am335x_lcd_methods, + sizeof(struct am335x_lcd_softc), +}; + +static devclass_t am335x_lcd_devclass; + +DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, am335x_lcd_devclass, 0, 0); +MODULE_VERSION(am335x_lcd, 1); +MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); Added: head/sys/arm/ti/am335x/am335x_lcd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd.h Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * 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 __AM335X_LCD_H__ +#define __AM335X_LCD_H__ + +struct panel_info { + uint32_t panel_width; + uint32_t panel_height; + uint32_t panel_hfp; + uint32_t panel_hbp; + uint32_t panel_hsw; + uint32_t panel_vfp; + uint32_t panel_vbp; + uint32_t panel_vsw; + uint32_t ac_bias; + uint32_t ac_bias_intrpt; + uint32_t dma_burst_sz; + uint32_t bpp; + uint32_t fdd; + uint32_t invert_line_clock; + uint32_t invert_frm_clock; + uint32_t sync_edge; + uint32_t sync_ctrl; + uint32_t panel_pxl_clk; + uint32_t panel_invert_pxl_clk; +}; + +int am335x_lcd_syscons_setup(vm_offset_t vaddr, vm_paddr_t paddr, + struct panel_info *panel); + +#endif /* __AM335X_LCD_H__ */ Added: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,793 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * 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 +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "am335x_lcd.h" + +struct video_adapter_softc { + /* Videoadpater part */ + video_adapter_t va; + int console; + + intptr_t fb_addr; + intptr_t fb_paddr; + unsigned int fb_size; + + unsigned int height; + unsigned int width; + unsigned int depth; + unsigned int stride; + + unsigned int xmargin; + unsigned int ymargin; + + unsigned char *font; + int initialized; +}; + +struct argb { + uint8_t a; + uint8_t r; + uint8_t g; + uint8_t b; +}; + +static struct argb am335x_syscons_palette[16] = { + {0x00, 0x00, 0x00, 0x00}, + {0x00, 0x00, 0x00, 0xaa}, + {0x00, 0x00, 0xaa, 0x00}, + {0x00, 0x00, 0xaa, 0xaa}, + {0x00, 0xaa, 0x00, 0x00}, + {0x00, 0xaa, 0x00, 0xaa}, + {0x00, 0xaa, 0x55, 0x00}, + {0x00, 0xaa, 0xaa, 0xaa}, + {0x00, 0x55, 0x55, 0x55}, + {0x00, 0x55, 0x55, 0xff}, + {0x00, 0x55, 0xff, 0x55}, + {0x00, 0x55, 0xff, 0xff}, + {0x00, 0xff, 0x55, 0x55}, + {0x00, 0xff, 0x55, 0xff}, + {0x00, 0xff, 0xff, 0x55}, + {0x00, 0xff, 0xff, 0xff} +}; + +/* mouse pointer from dev/syscons/scgfbrndr.c */ +static u_char mouse_pointer[16] = { + 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, + 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 +}; + +#define AM335X_FONT_HEIGHT 16 + +#define FB_WIDTH 640 +#define FB_HEIGHT 480 +#define FB_DEPTH 24 + +static struct video_adapter_softc va_softc; + +static int am335x_syscons_configure(int flags); + +/* + * Video driver routines and glue. + */ +static vi_probe_t am335x_syscons_probe; +static vi_init_t am335x_syscons_init; +static vi_get_info_t am335x_syscons_get_info; +static vi_query_mode_t am335x_syscons_query_mode; +static vi_set_mode_t am335x_syscons_set_mode; +static vi_save_font_t am335x_syscons_save_font; +static vi_load_font_t am335x_syscons_load_font; +static vi_show_font_t am335x_syscons_show_font; +static vi_save_palette_t am335x_syscons_save_palette; +static vi_load_palette_t am335x_syscons_load_palette; +static vi_set_border_t am335x_syscons_set_border; +static vi_save_state_t am335x_syscons_save_state; +static vi_load_state_t am335x_syscons_load_state; +static vi_set_win_org_t am335x_syscons_set_win_org; +static vi_read_hw_cursor_t am335x_syscons_read_hw_cursor; +static vi_set_hw_cursor_t am335x_syscons_set_hw_cursor; +static vi_set_hw_cursor_shape_t am335x_syscons_set_hw_cursor_shape; +static vi_blank_display_t am335x_syscons_blank_display; +static vi_mmap_t am335x_syscons_mmap; +static vi_ioctl_t am335x_syscons_ioctl; +static vi_clear_t am335x_syscons_clear; +static vi_fill_rect_t am335x_syscons_fill_rect; +static vi_bitblt_t am335x_syscons_bitblt; +static vi_diag_t am335x_syscons_diag; +static vi_save_cursor_palette_t am335x_syscons_save_cursor_palette; +static vi_load_cursor_palette_t am335x_syscons_load_cursor_palette; +static vi_copy_t am335x_syscons_copy; +static vi_putp_t am335x_syscons_putp; +static vi_putc_t am335x_syscons_putc; +static vi_puts_t am335x_syscons_puts; +static vi_putm_t am335x_syscons_putm; + +static video_switch_t am335x_sysconsvidsw = { + .probe = am335x_syscons_probe, + .init = am335x_syscons_init, + .get_info = am335x_syscons_get_info, + .query_mode = am335x_syscons_query_mode, + .set_mode = am335x_syscons_set_mode, + .save_font = am335x_syscons_save_font, + .load_font = am335x_syscons_load_font, + .show_font = am335x_syscons_show_font, + .save_palette = am335x_syscons_save_palette, + .load_palette = am335x_syscons_load_palette, + .set_border = am335x_syscons_set_border, + .save_state = am335x_syscons_save_state, + .load_state = am335x_syscons_load_state, + .set_win_org = am335x_syscons_set_win_org, + .read_hw_cursor = am335x_syscons_read_hw_cursor, + .set_hw_cursor = am335x_syscons_set_hw_cursor, + .set_hw_cursor_shape = am335x_syscons_set_hw_cursor_shape, + .blank_display = am335x_syscons_blank_display, + .mmap = am335x_syscons_mmap, + .ioctl = am335x_syscons_ioctl, + .clear = am335x_syscons_clear, + .fill_rect = am335x_syscons_fill_rect, + .bitblt = am335x_syscons_bitblt, + .diag = am335x_syscons_diag, + .save_cursor_palette = am335x_syscons_save_cursor_palette, + .load_cursor_palette = am335x_syscons_load_cursor_palette, + .copy = am335x_syscons_copy, + .putp = am335x_syscons_putp, + .putc = am335x_syscons_putc, + .puts = am335x_syscons_puts, + .putm = am335x_syscons_putm, +}; + +VIDEO_DRIVER(am335x_syscons, am335x_sysconsvidsw, am335x_syscons_configure); + +static vr_init_t am335x_rend_init; +static vr_clear_t am335x_rend_clear; +static vr_draw_border_t am335x_rend_draw_border; +static vr_draw_t am335x_rend_draw; +static vr_set_cursor_t am335x_rend_set_cursor; +static vr_draw_cursor_t am335x_rend_draw_cursor; +static vr_blink_cursor_t am335x_rend_blink_cursor; +static vr_set_mouse_t am335x_rend_set_mouse; +static vr_draw_mouse_t am335x_rend_draw_mouse; + +/* + * We use our own renderer; this is because we must emulate a hardware + * cursor. + */ +static sc_rndr_sw_t am335x_rend = { + am335x_rend_init, + am335x_rend_clear, + am335x_rend_draw_border, + am335x_rend_draw, + am335x_rend_set_cursor, + am335x_rend_draw_cursor, + am335x_rend_blink_cursor, + am335x_rend_set_mouse, + am335x_rend_draw_mouse +}; + +RENDERER(am335x_syscons, 0, am335x_rend, gfb_set); +RENDERER_MODULE(am335x_syscons, gfb_set); + +static void +am335x_rend_init(scr_stat* scp) +{ +} + +static void +am335x_rend_clear(scr_stat* scp, int c, int attr) +{ +} + +static void +am335x_rend_draw_border(scr_stat* scp, int color) +{ +} + +static void +am335x_rend_draw(scr_stat* scp, int from, int count, int flip) +{ + video_adapter_t* adp = scp->sc->adp; + int i, c, a; + + if (!flip) { + /* Normal printing */ + vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count); + } else { + /* This is for selections and such: invert the color attribute */ + for (i = count; i-- > 0; ++from) { + c = sc_vtb_getc(&scp->vtb, from); + a = sc_vtb_geta(&scp->vtb, from) >> 8; + vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); + } + } +} + +static void +am335x_rend_set_cursor(scr_stat* scp, int base, int height, int blink) +{ +} + +static void +am335x_rend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip) +{ + video_adapter_t* adp = scp->sc->adp; + struct video_adapter_softc *sc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:23:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD42CAFB; Mon, 27 May 2013 00:23:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF9EA658; Mon, 27 May 2013 00:23:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0Nxav043152; Mon, 27 May 2013 00:23:59 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0NxLN043151; Mon, 27 May 2013 00:23:59 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270023.r4R0NxLN043151@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251019 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:23:59 -0000 Author: gonzo Date: Mon May 27 00:23:59 2013 New Revision: 251019 URL: http://svnweb.freebsd.org/changeset/base/251019 Log: Add PWM and LCDC nodes to base DTS for AM335x-based devices Modified: head/sys/boot/fdt/dts/am335x.dtsi Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:01 2013 (r251018) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:59 2013 (r251019) @@ -150,5 +150,28 @@ interrupt-parent = <&AINTC>; i2c-device-id = <0>; }; + + pwm@48300000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48300000 0x100 /* PWMSS */ + 0x48300100 0x80 /* eCAP0 */ + 0x48300180 0x80 /* eQEP0 */ + 0x48300200 0x60 /* ePWM0 */ + >; + interrupts = <86 58>; /* ePWM0INT, ePWM0_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <0>; + }; + + lcd: lcd@4830e000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,am335x-lcd"; + reg =< 0x4830e000 0x1000 >; + interrupts = <36>; + interrupt-parent = <&AINTC>; + }; }; }; From owner-svn-src-head@FreeBSD.ORG Mon May 27 00:26:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9248C8C; Mon, 27 May 2013 00:26:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAE0366A; Mon, 27 May 2013 00:26:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R0QTS8043635; Mon, 27 May 2013 00:26:29 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R0QTtu043634; Mon, 27 May 2013 00:26:29 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201305270026.r4R0QTtu043634@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 May 2013 00:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251020 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 00:26:29 -0000 Author: gonzo Date: Mon May 27 00:26:29 2013 New Revision: 251020 URL: http://svnweb.freebsd.org/changeset/base/251020 Log: Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and LCD panel description Added: head/sys/boot/fdt/dts/am335x-evm.dts (contents, props changed) Added: head/sys/boot/fdt/dts/am335x-evm.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/am335x-evm.dts Mon May 27 00:26:29 2013 (r251020) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * 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$ + */ + +/dts-v1/; + +/include/ "am335x.dtsi" + +/ { + model = "TMDXEVM3358"; + compatible = "ti,am335x"; + + aliases { + soc = &SOC; + uart0 = &uart0; + }; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ + }; + + am335x { + scm@44e10000 { + /* Set of triplets < padname, muxname, padstate> */ + scm-pad-config = + /* I2C0 */ + "I2C0_SDA", "I2C0_SDA","i2c", + "I2C0_SCL", "I2C0_SCL","i2c", + /* Ethernet */ + "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", + "MII1_TX_EN", "gmii1_txen", "output", + "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", + "MII1_TXD3", "gmii1_txd3", "output", + "MII1_TXD2", "gmii1_txd2", "output", + "MII1_TXD1", "gmii1_txd1", "output", + "MII1_TXD0", "gmii1_txd0", "output", + "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", + "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", + "MII1_RXD3", "gmii1_rxd3", "input_pulldown", + "MII1_RXD2", "gmii1_rxd2", "input_pulldown", + "MII1_RXD1", "gmii1_rxd1", "input_pulldown", + "MII1_RXD0", "gmii1_rxd0", "input_pulldown", + "MDIO", "mdio_data", "input_pullup", + "MDC", "mdio_clk", "output_pullup", + /* MMCSD0 */ + "MMC0_CMD", "mmc0_cmd", "input_pullup", + "MMC0_CLK", "mmc0_clk", "input_pullup", + "MMC0_DAT0", "mmc0_dat0", "input_pullup", + "MMC0_DAT1", "mmc0_dat1", "input_pullup", + "MMC0_DAT2", "mmc0_dat2", "input_pullup", + "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* GPIO */ + "GPMC_AD10", "gpio0_26", "input_pulldown", + "GPMC_AD11", "gpio0_27", "input_pulldown", + "GPMC_AD0", "gpio1_0", "input_pulldown", + "GPMC_AD1", "gpio1_1", "input_pulldown", + "GPMC_AD2", "gpio1_2", "input_pulldown", + "GPMC_AD3", "gpio1_3", "input_pulldown", + "GPMC_AD4", "gpio1_4", "input_pulldown", + "GPMC_AD5", "gpio1_5", "input_pulldown", + "GPMC_AD6", "gpio1_6", "input_pulldown", + "GPMC_AD7", "gpio1_7", "input_pulldown", + "GPMC_AD12", "gpio1_12", "input_pulldown", + "GPMC_AD13", "gpio1_13", "input_pulldown", + "GPMC_AD14", "gpio1_14", "input_pulldown", + "GPMC_AD15", "gpio1_15", "input_pulldown", + "GPMC_A0", "gpio1_16", "input_pulldown", + "GPMC_A1", "gpio1_17", "input_pulldown", + "GPMC_A5", "gpio1_21", "output", /* User LED 1 */ + "GPMC_A6", "gpio1_22", "output", /* User LED 2 */ + "GPMC_A7", "gpio1_23", "output", /* User LED 3 */ + "GPMC_A8", "gpio1_24", "output", /* User LED 4 */ + "GPMC_BEn1", "gpio1_28", "input_pulldown", + "GPMC_CSn0", "gpio1_29", "input_pulldown", + "GPMC_CSn1", "gpio1_30", "input_pulldown", + "GPMC_CSn2", "gpio1_31", "input_pulldown", + "MCASP0_FSR", "gpio3_19", "input_pulldown", + "MCASP0_AHCLKX", "gpio3_21", "input_pulldown", + /* TIMERs */ + "GPMC_ADVn_ALE", "timer4", "output", + "GPMC_BEn0_CLE", "timer5", "output", + "GPMC_WEn", "timer6", "output", + "GPMC_OEn_REn", "timer7", "output", + /* LCD */ + "GPMC_AD8", "lcd_data23", "output", + "GPMC_AD9", "lcd_data22", "output", + "GPMC_AD10", "lcd_data21", "output", + "GPMC_AD11", "lcd_data20", "output", + "GPMC_AD12", "lcd_data19", "output", + "GPMC_AD13", "lcd_data18", "output", + "GPMC_AD14", "lcd_data17", "output", + "GPMC_AD15", "lcd_data16", "output", + "GPMC_CLK", "lcd_memory_clk", "output", + "LCD_DATA0", "lcd_data0", "output", + "LCD_DATA1", "lcd_data1", "output", + "LCD_DATA2", "lcd_data2", "output", + "LCD_DATA3", "lcd_data3", "output", + "LCD_DATA4", "lcd_data4", "output", + "LCD_DATA5", "lcd_data5", "output", + "LCD_DATA6", "lcd_data6", "output", + "LCD_DATA7", "lcd_data7", "output", + "LCD_DATA8", "lcd_data8", "output", + "LCD_DATA9", "lcd_data9", "output", + "LCD_DATA10", "lcd_data10", "output", + "LCD_DATA11", "lcd_data11", "output", + "LCD_DATA12", "lcd_data12", "output", + "LCD_DATA13", "lcd_data13", "output", + "LCD_DATA14", "lcd_data14", "output", + "LCD_DATA15", "lcd_data15", "output", + "LCD_VSYNC", "lcd_vsync", "output", + "LCD_HSYNC", "lcd_hsync", "output", + "LCD_PCLK", "lcd_pclk", "output", + "LCD_AC_BIAS_EN", "lcd_ac_bias_en", "output", + "ECAP0_IN_PWM0_OUT", "eCAP0_in_PWM0_out", "output"; + + }; + + lcd@4830e000 { + panel_name = "TFC_S9700RTWV35TR_01B"; + panel_width = <800>; + panel_height = <480>; + panel_hfp = <39>; + panel_hbp = <39>; + panel_hsw = <47>; + panel_vfp = <13>; + panel_vbp = <29>; + panel_vsw = <2>; + panel_pxl_clk = <30000000>; + panel_invert_pxl_clk = <0>; + panel_type = <1>; /* Active or passive, compatibility */ + panel_max_bpp = <32>; /* compatibility */ + panel_min_bpp = <32>; /* compatibility */ + panel_shade = <1>; /* compatibility */ + ac_bias = <255>; + ac_bias_intrpt = <0>; + dma_burst_sz = <16>; + bpp = <32>; + fdd = <128>; + tft_alt_mode = <0>; /* compatiblity */ + stn_565_mode = <0>; /* compatibility */ + mono_8bit_mode = <0>; /* compatibilty */ + invert_line_clock = <1>; + invert_frm_clock = <1>; + sync_edge = <0>; + sync_ctrl = <1>; + raster_order = <0>; /* compatibity */ + }; + + }; + + chosen { + stdin = "uart0"; + stdout = "uart0"; + }; +}; From owner-svn-src-head@FreeBSD.ORG Mon May 27 06:24:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A293752; Mon, 27 May 2013 06:24:32 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0335DF; Mon, 27 May 2013 06:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R6OWUt061035; Mon, 27 May 2013 06:24:32 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R6OVmS061031; Mon, 27 May 2013 06:24:31 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305270624.r4R6OVmS061031@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 27 May 2013 06:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251022 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 06:24:32 -0000 Author: gber Date: Mon May 27 06:24:31 2013 New Revision: 251022 URL: http://svnweb.freebsd.org/changeset/base/251022 Log: Fix ONFI chip detection. Submitted by: Alexander Fedorov Modified: head/sys/dev/nand/nand.h head/sys/dev/nand/nandbus.c Modified: head/sys/dev/nand/nand.h ============================================================================== --- head/sys/dev/nand/nand.h Mon May 27 03:09:26 2013 (r251021) +++ head/sys/dev/nand/nand.h Mon May 27 06:24:31 2013 (r251022) @@ -219,7 +219,7 @@ struct onfi_params { uint16_t vendor_rev; uint8_t vendor_spec[8]; uint16_t crc; -}; +}__attribute__((packed)); struct nand_ecc_data { int eccsize; /* Number of data bytes per ECC step */ Modified: head/sys/dev/nand/nandbus.c ============================================================================== --- head/sys/dev/nand/nandbus.c Mon May 27 03:09:26 2013 (r251021) +++ head/sys/dev/nand/nandbus.c Mon May 27 06:24:31 2013 (r251022) @@ -331,7 +331,7 @@ static int nand_probe_onfi(device_t bus, uint8_t *onfi_compliant) { device_t nfc; - char onfi_id[] = {'o', 'n', 'f', 'i', '\0'}; + char onfi_id[] = {'O', 'N', 'F', 'I', '\0'}; int i; nand_debug(NDBG_BUS,"probing ONFI"); From owner-svn-src-head@FreeBSD.ORG Mon May 27 06:32:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C59F1B4E; Mon, 27 May 2013 06:32:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B89E664A; Mon, 27 May 2013 06:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R6W77I064002; Mon, 27 May 2013 06:32:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R6W7EP063999; Mon, 27 May 2013 06:32:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305270632.r4R6W7EP063999@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 27 May 2013 06:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251023 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 06:32:07 -0000 Author: hselasky Date: Mon May 27 06:32:07 2013 New Revision: 251023 URL: http://svnweb.freebsd.org/changeset/base/251023 Log: Workaround for for a problem seen with ATI Technologies EHCI controller hardware most likely present on UHCI chipsets aswell. The bug manifests itself when issuing isochronous transfers and bulk transfers towards the same device simultaneously. From time to time it happens that either the completion IRQ was missing or that the completion IRQ was happening before the ITD/SITD was completely written back to memory. The workaround assumes that double buffered isochronous transfers are used, and that a second interrupt is generated at the beginning of the next isochronous transfer to complete the previous one. Possibly skipping the interrupt at the last isochronous frame is possible, but will then break single buffered isochronous transfers. For now we can live with some extra interrupts. MFC after: 1 week Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon May 27 06:24:31 2013 (r251022) +++ head/sys/dev/usb/controller/ehci.c Mon May 27 06:32:07 2013 (r251023) @@ -2454,6 +2454,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe uint16_t tlen; uint8_t sa; uint8_t sb; + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2618,6 +2619,16 @@ ehci_device_isoc_fs_enter(struct usb_xfe EHCI_SITD_IOC | EHCI_SITD_ACTIVE | EHCI_SITD_SET_LEN(*plen)); + } else if (first != 0) { + /* + * Workaround for lost or too early + * completion interrupt: + */ + first = 0; + td->sitd_status = htohc32(sc, + EHCI_SITD_IOC | + EHCI_SITD_ACTIVE | + EHCI_SITD_SET_LEN(*plen)); } else { td->sitd_status = htohc32(sc, EHCI_SITD_ACTIVE | @@ -2759,6 +2770,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe uint8_t td_no; uint8_t page_no; uint8_t shift = usbd_xfer_get_fps_shift(xfer); + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2920,6 +2932,13 @@ ehci_device_isoc_hs_enter(struct usb_xfe /* set IOC bit if we are complete */ if (nframes == 0) { td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); + } else if (first != 0) { + /* + * Workaround for lost or too early + * completion interrupt: + */ + first = 0; + td->itd_status[0] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #ifdef USB_DEBUG Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Mon May 27 06:24:31 2013 (r251022) +++ head/sys/dev/usb/controller/uhci.c Mon May 27 06:32:07 2013 (r251023) @@ -2138,6 +2138,7 @@ uhci_device_isoc_enter(struct usb_xfer * uint32_t nframes; uint32_t temp; uint32_t *plen; + uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2253,6 +2254,18 @@ uhci_device_isoc_enter(struct usb_xfer * UHCI_TD_ACTIVE | UHCI_TD_IOS | UHCI_TD_IOC)); + } else if (first != 0) { + /* + * Workaround for lost or too early completion + * interrupt: + */ + first = 0; + td->td_status = htole32 + (UHCI_TD_ZERO_ACTLEN + (UHCI_TD_SET_ERRCNT(0) | + UHCI_TD_ACTIVE | + UHCI_TD_IOS | + UHCI_TD_IOC)); } else { td->td_status = htole32 (UHCI_TD_ZERO_ACTLEN From owner-svn-src-head@FreeBSD.ORG Mon May 27 08:33:38 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B73E4283; Mon, 27 May 2013 08:33:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id C1B9ED54; Mon, 27 May 2013 08:33:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4R8XILn001101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 May 2013 18:33:22 +1000 Date: Mon, 27 May 2013 18:33:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser Subject: Re: svn commit: r250972 - head/usr.bin/patch In-Reply-To: <51A26FED.4020801@freebsd.org> Message-ID: <20130527172803.P1491@besplex.bde.org> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> <20130525122811.I837@besplex.bde.org> <51A26FED.4020801@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=0a0yn1FGu_gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=LFobCLJwE3wA:10 a=x0QUDIz939gMxI9YZRcA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Stefan Esser , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 08:33:38 -0000 n Sun, 26 May 2013, Stefan Esser wrote: > Am 25.05.2013 06:31, schrieb Bruce Evans: >> On Fri, 24 May 2013, Stefan Esser wrote: > ... > Another possibility (too obfuscated for my taste) is: > > if (ferror(ofp) { > fclose(ofp); > ofp = NULL; > } > if (ofp == NULL || fclose(ofp)) > say ... > error = 1 > } > > This version does not need the temporary result variable, > but uses two calls to fclose() and thus produces more code. > >> This is too ugly. I prefer to depend on fclose() being non-broken. >> Unfortunately, fclose() seems to be broken in FreeBSD: > > Ughh. That might be the reason the ferror() tests were added > in the FreeBSD version ... The addition is fairly recent. I don't see any reason for it. > ... > Do we have compatibility and/or regression tests for stdio that > cover ferror/fflush/fclose? Not that I know of. > I'm wondering, whether we could just implicitly call fflush before > fclose and return an error condition, if the fflush failed. That > way, fclose would report write errors only reported by fflush, now. fflush() seems to be the most broken (see below), so using it increases problems. > The fclose(3) man-page states: > > ERRORS > The fclose() function may also fail and set errno for any of the > errors specified for the routines close(2) or fflush(3). > > So, returning fflush errors from fclose is documented behavior, but > apparently not implemented behavior. This is fuzzy wording. C99 says even less (nothing explicit about errno), but POSIX is much more specific and says "shall fail" for most of the errors specified for close() and fflush(). But at least in the 2001 draft 7, it also has bugs like specifying that st_ntime and st_ctime "[shall be marked for update], if the stream was writable, and if buffered data remains". This not only has bad grammar; it also specifies the update if the write fails. This is inconsistent with the specification of write(), that it only updates the times if it succeeds. fclose() has this bug in a worse form. Similarly for fflush(), except the wording is better and more clearly mis-specifies that the update always occurs iff any buffered data remains. So the above should say that fclose() does fail and set ferror() if any of underlying functions (which are not necessarily write() and close() fails. fflush() is only directly underlying, and of course it must fail and set error if its underying functions fail. I don't know of any implementations that get this wrong. > One way to test write errors is via tmpfs: > > # mount -t tmpfs -o maxfilesize=1 tmp /mnt A bit hard for me, since I don't believe in tmpfs and don't have it on any of my systems. > > A few more tests with this special file system: > > ----------------------------------------------------------------- > #include > > int > main(void) > { > FILE *fp; > > remove("test.dat"); > fprintf(stderr, "1) normal write - expect OK:\n"); > fp = fopen("test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("a\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n2) write 1 byte - expect OK:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n3) write 1 byte - expect OK:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w+"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n4) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n5) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n6) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n7) write 3 bytes - expect FAIL:\n"); > remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "w"); > fprintf(stderr, "fwrite %zu\n", fwrite("c\n", 1, 3, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > // > fprintf(stderr, "\n8) write 1 bytes to R/O file - expect FAIL:\n"); > //remove("/mnt/test.dat"); > fp = fopen("/mnt/test.dat", "r"); > fprintf(stderr, "fwrite %zu\n", fwrite("b\n", 1, 1, fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fflush %d\n", fflush(fp)); > fprintf(stderr, "ferror %d\n", ferror(fp)); > fprintf(stderr, "fclose %d\n", fclose(fp)); > > return (0); > } > ----------------------------------------------------------------- > 5) write 3 bytes - expect FAIL: > fwrite 3 > fflush -1 > fclose 0 fflush() seems to be very broken. It really does flush (discard) all buffered data if there is a write error during the write(s) (and of course it won't tell where the error occurred. Just another reason why stdio should never be used. This misbehaviour seems to be intentional: from libc/stdio/fflush.c: % int % __sflush(FILE *fp) % { % unsigned char *p; % int n, t; % % t = fp->_flags; % if ((t & __SWR) == 0) % return (0); % % if ((p = fp->_bf._base) == NULL) % return (0); % % n = fp->_p - p; /* write this much */ % % /* % * Set these immediately to avoid problems with longjmp and to allow % * exchange buffering (via setvbuf) in user write function. % */ % fp->_p = p; It remembers how much to write, then advances the pointer and forgets where it was. longjump will cause much larger problems now than when the above was written, and a don't understand the point about exchange buffering. This is normally (always from at least fflush()) called with FLOCKFILE(), so if the lock is not null then longjmp would be especially fatal, but maybe locking prevents problems with exchange buffering. % fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size; % % for (; n > 0; n -= t, p += t) { % t = _swrite(fp, (char *)p, n); % if (t <= 0) { n gives the amount not written, so we could easily reset the pointer, but we don't. Locking should prevent any external use of the FILE object while it is in an intermediate state. % fp->_flags |= __SERR; % return (EOF); % } % } % return (0); % } Standards don't say anything to explicitly allow fflush() to flush (discard) unwritable data. C99 says very little about anything in fflush(). POSIX adds mainly - a description of errors that shall be detected - an example of fflush()ing stdout before using stdin (but nothing about automatic fflush()ing of stdout that most unix stdios actually do) - a rationale about the file position. The file position causes further complications for failing fflush()es. Currently I think neither the stdio position nor the kernel position is advanced for the failed part of the write. This is as consistent as possible, but means that you can't track the position by counting the bytes claimed to have been written by fwrite() and putc(), etc. > 6) write 3 bytes - expect FAIL: > fwrite 3 > ferror 0 > fclose -1 Now when we don't try fflush() first, fclose() can actually see the buffered data and fail trying to write it. > So it seems that fclose will return an error if data could not be > written (see case 4), but not if an fflush already returned the > error condition. It is not sticky. > > So I guess it is sufficient to check the result returned by fclose, > without the prior check of ferror. I do not see what cases ferror > can catch, that are no caught by fclose ... Now I see a problem that is large enough to require the the ferror()s: __sflush() is called not only from fflush(), but for general operation. Even putc() calls if fairly directly (via __swbuf() and __fflush()). So when __sflush() fails in certain contexts, the only evidence of it trashing the buffer is the sticky ferror() flag and the not-sticky error return to functions like putc() and printf(). Most callers don't check the results of their putc()'s and printf()'s. Hopefully printf() itself checks, but patch(1) seems to use only fputs() and putc() to write to ofp, and it _never_ checks their results. So in most cases there is something in the buffer at fclose() time and fclose() detects most errors in these cases (there might be previous undetected errors but most error conditions are sticky at the fs level). But sometimes the auto-flush might occur on the last byte of a file. Then trashing the buffer would leave no problem for fclose() to detect. Bruce From owner-svn-src-head@FreeBSD.ORG Mon May 27 08:34:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45C0E409; Mon, 27 May 2013 08:34:45 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 2C573D5F; Mon, 27 May 2013 08:34:44 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4R8YfVG001493; Mon, 27 May 2013 01:34:41 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4R8YfT8001492; Mon, 27 May 2013 01:34:41 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 27 May 2013 01:34:41 -0700 From: David Schultz To: Ed Schouten Subject: Re: svn commit: r250990 - head/include Message-ID: <20130527083441.GA1309@zim.MIT.EDU> References: <201305251855.r4PIttB7052695@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305251855.r4PIttB7052695@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 08:34:45 -0000 On Sat, May 25, 2013, Ed Schouten wrote: > Author: ed > Date: Sat May 25 18:55:55 2013 > New Revision: 250990 > URL: http://svnweb.freebsd.org/changeset/base/250990 > > Log: > Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). > > Clang allows us to initialize complex numbers using an array > initializer, casted to a complex type. GCC has a builtin called > __builtin_complex(). Awesome, thanks! I recall that we talked about this last year, and the blocking issue was that gcc didn't support it. It appears that the one in the base system still doesn't, but now that clang is the default compiler, maybe that doesn't matter. There are some regression tests in tools/regression/lib/msun that could be converted to exercise these macros if you wish: grep for "cpack". From owner-svn-src-head@FreeBSD.ORG Mon May 27 08:50:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A9ACC64; Mon, 27 May 2013 08:50:15 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0A3E10; Mon, 27 May 2013 08:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R8oFHt008979; Mon, 27 May 2013 08:50:15 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R8oA6g008947; Mon, 27 May 2013 08:50:10 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305270850.r4R8oA6g008947@svn.freebsd.org> From: David Schultz Date: Mon, 27 May 2013 08:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 08:50:15 -0000 Author: das Date: Mon May 27 08:50:10 2013 New Revision: 251024 URL: http://svnweb.freebsd.org/changeset/base/251024 Log: Fix some regressions caused by the switch from gcc to clang. The fixes are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet. Modified: head/lib/msun/Makefile head/lib/msun/ld128/s_exp2l.c head/lib/msun/ld80/s_exp2l.c head/lib/msun/src/e_exp.c head/lib/msun/src/e_expf.c head/lib/msun/src/e_log.c head/lib/msun/src/e_log10.c head/lib/msun/src/e_log10f.c head/lib/msun/src/e_log2.c head/lib/msun/src/e_log2f.c head/lib/msun/src/e_logf.c head/lib/msun/src/s_exp2.c head/lib/msun/src/s_exp2f.c head/lib/msun/src/s_expm1.c head/lib/msun/src/s_expm1f.c head/lib/msun/src/s_fma.c head/lib/msun/src/s_fmal.c head/lib/msun/src/s_log1p.c head/lib/msun/src/s_log1pf.c head/lib/msun/src/s_nearbyint.c head/tools/regression/lib/msun/test-fma.c Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/Makefile Mon May 27 08:50:10 2013 (r251024) @@ -121,12 +121,6 @@ COMMON_SRCS:= ${COMMON_SRCS:N${i:R}.c} .endfor .endif -# Some files need certain gcc built-in functions to be disabled, since gcc's -# model of the functions bogusly assumes -fno-trapping-math. -XRINT_CFLAGS= -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl -CFLAGS+= ${XRINT_CFLAGS} -XRINT_CFLAGS:= ${.IMPSRC:M*/s_nearbyint.c:C/^.+$/${XRINT_CFLAGS}/:C/^$//} - SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS+= fenv.h math.h Modified: head/lib/msun/ld128/s_exp2l.c ============================================================================== --- head/lib/msun/ld128/s_exp2l.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/ld128/s_exp2l.c Mon May 27 08:50:10 2013 (r251024) @@ -39,14 +39,11 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) #define EXPMASK (BIAS + LDBL_MAX_EXP) -#if 0 /* XXX Prevent gcc from erroneously constant folding this. */ -static const long double twom10000 = 0x1p-10000L; -#else -static volatile long double twom10000 = 0x1p-10000L; -#endif +static volatile long double + huge = 0x1p10000L, + twom10000 = 0x1p-10000L; static const long double - huge = 0x1p10000L, P1 = 0x1.62e42fefa39ef35793c7673007e6p-1L, P2 = 0x1.ebfbdff82c58ea86f16b06ec9736p-3L, P3 = 0x1.c6b08d704a0bf8b33a762bad3459p-5L, Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 08:50:10 2013 (r251024) @@ -43,12 +43,9 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) #define EXPMASK (BIAS + LDBL_MAX_EXP) -static const long double huge = 0x1p10000L; -#if 0 /* XXX Prevent gcc from erroneously constant folding this. */ -static const long double twom10000 = 0x1p-10000L; -#else -static volatile long double twom10000 = 0x1p-10000L; -#endif +static volatile long double + huge = 0x1p10000L, + twom10000 = 0x1p-10000L; static const double redux = 0x1.8p63 / TBLSIZE, Modified: head/lib/msun/src/e_exp.c ============================================================================== --- head/lib/msun/src/e_exp.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_exp.c Mon May 27 08:50:10 2013 (r251024) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, halF[2] = {0.5,-0.5,}, -huge = 1.0e+300, o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */ ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */ @@ -99,6 +98,7 @@ P4 = -1.65339022054652515390e-06, /* 0 P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ static volatile double +huge = 1.0e+300, twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ double Modified: head/lib/msun/src/e_expf.c ============================================================================== --- head/lib/msun/src/e_expf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_expf.c Mon May 27 08:50:10 2013 (r251024) @@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, halF[2] = {0.5,-0.5,}, -huge = 1.0e+30, o_threshold= 8.8721679688e+01, /* 0x42b17180 */ u_threshold= -1.0397208405e+02, /* 0xc2cff1b5 */ ln2HI[2] ={ 6.9314575195e-01, /* 0x3f317200 */ @@ -39,7 +38,9 @@ invln2 = 1.4426950216e+00, /* 0x3fb8a P1 = 1.6666625440e-1, /* 0xaaaa8f.0p-26 */ P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */ -static volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ +static volatile float +huge = 1.0e+30, +twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ float __ieee754_expf(float x) Modified: head/lib/msun/src/e_log.c ============================================================================== --- head/lib/msun/src/e_log.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log.c Mon May 27 08:50:10 2013 (r251024) @@ -81,6 +81,7 @@ Lg6 = 1.531383769920937332e-01, /* 3FC3 Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log(double x) @@ -94,7 +95,7 @@ __ieee754_log(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log10.c ============================================================================== --- head/lib/msun/src/e_log10.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log10.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ log10_2hi = 3.01029995663611771306e-01 log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log10(double x) @@ -47,7 +48,7 @@ __ieee754_log10(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log10f.c ============================================================================== --- head/lib/msun/src/e_log10f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log10f.c Mon May 27 08:50:10 2013 (r251024) @@ -28,6 +28,7 @@ log10_2hi = 3.0102920532e-01, /* 0x3e9 log10_2lo = 7.9034151668e-07; /* 0x355427db */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_log10f(float x) @@ -40,7 +41,7 @@ __ieee754_log10f(float x) k=0; if (hx < 0x00800000) { /* x < 2**-126 */ if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); Modified: head/lib/msun/src/e_log2.c ============================================================================== --- head/lib/msun/src/e_log2.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log2.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ ivln2hi = 1.44269504072144627571e+00 ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double __ieee754_log2(double x) @@ -47,7 +48,7 @@ __ieee754_log2(double x) k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ + return -two54/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); Modified: head/lib/msun/src/e_log2f.c ============================================================================== --- head/lib/msun/src/e_log2f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_log2f.c Mon May 27 08:50:10 2013 (r251024) @@ -26,6 +26,7 @@ ivln2hi = 1.4428710938e+00, /* 0x3fb ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_log2f(float x) @@ -38,7 +39,7 @@ __ieee754_log2f(float x) k=0; if (hx < 0x00800000) { /* x < 2**-126 */ if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); Modified: head/lib/msun/src/e_logf.c ============================================================================== --- head/lib/msun/src/e_logf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/e_logf.c Mon May 27 08:50:10 2013 (r251024) @@ -30,6 +30,7 @@ Lg3 = 0x91e9ee.0p-25, /* 0.28498786 Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float __ieee754_logf(float x) @@ -42,7 +43,7 @@ __ieee754_logf(float x) k=0; if (ix < 0x00800000) { /* x < 2**-126 */ if ((ix&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ + return -two25/vzero; /* log(+-0)=-inf */ if (ix<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(ix,x); Modified: head/lib/msun/src/s_exp2.c ============================================================================== --- head/lib/msun/src/s_exp2.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_exp2.c Mon May 27 08:50:10 2013 (r251024) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #define TBLSIZE (1 << TBLBITS) static const double - huge = 0x1p1000, redux = 0x1.8p52 / TBLSIZE, P1 = 0x1.62e42fefa39efp-1, P2 = 0x1.ebfbdff82c575p-3, @@ -44,7 +43,9 @@ static const double P4 = 0x1.3b2ab88f70400p-7, P5 = 0x1.5d88003875c74p-10; -static volatile double twom1000 = 0x1p-1000; +static volatile double + huge = 0x1p1000, + twom1000 = 0x1p-1000; static const double tbl[TBLSIZE * 2] = { /* exp2(z + eps) eps */ Modified: head/lib/msun/src/s_exp2f.c ============================================================================== --- head/lib/msun/src/s_exp2f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_exp2f.c Mon May 27 08:50:10 2013 (r251024) @@ -36,14 +36,15 @@ __FBSDID("$FreeBSD$"); #define TBLSIZE (1 << TBLBITS) static const float - huge = 0x1p100f, redux = 0x1.8p23f / TBLSIZE, P1 = 0x1.62e430p-1f, P2 = 0x1.ebfbe0p-3f, P3 = 0x1.c6b348p-5f, P4 = 0x1.3b2c9cp-7f; -static volatile float twom100 = 0x1p-100f; +static volatile float + huge = 0x1p100f, + twom100 = 0x1p-100f; static const double exp2ft[TBLSIZE] = { 0x1.6a09e667f3bcdp-1, Modified: head/lib/msun/src/s_expm1.c ============================================================================== --- head/lib/msun/src/s_expm1.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_expm1.c Mon May 27 08:50:10 2013 (r251024) @@ -115,7 +115,6 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, -huge = 1.0e+300, tiny = 1.0e-300, o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */ ln2_hi = 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */ @@ -128,6 +127,8 @@ Q3 = -7.93650757867487942473e-05, /* B Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ +static volatile double huge = 1.0e+300; + double expm1(double x) { Modified: head/lib/msun/src/s_expm1f.c ============================================================================== --- head/lib/msun/src/s_expm1f.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_expm1f.c Mon May 27 08:50:10 2013 (r251024) @@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, -huge = 1.0e+30, tiny = 1.0e-30, o_threshold = 8.8721679688e+01,/* 0x42b17180 */ ln2_hi = 6.9313812256e-01,/* 0x3f317180 */ @@ -37,6 +36,8 @@ invln2 = 1.4426950216e+00,/* 0x3fb8aa3b Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */ Q2 = 1.5807170421e-3; /* 0xcf3010.0p-33 */ +static volatile float huge = 1.0e+30; + float expm1f(float x) { Modified: head/lib/msun/src/s_fma.c ============================================================================== --- head/lib/msun/src/s_fma.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_fma.c Mon May 27 08:50:10 2013 (r251024) @@ -238,6 +238,8 @@ fma(double x, double y, double z) zs = copysign(DBL_MIN, zs); fesetround(FE_TONEAREST); + /* work around clang bug 8100 */ + volatile double vxs = xs; /* * Basic approach for round-to-nearest: @@ -247,7 +249,7 @@ fma(double x, double y, double z) * adj = xy.lo + r.lo (inexact; low bit is sticky) * result = r.hi + adj (correctly rounded) */ - xy = dd_mul(xs, ys); + xy = dd_mul(vxs, ys); r = dd_add(xy.hi, zs); spread = ex + ey; @@ -268,7 +270,9 @@ fma(double x, double y, double z) * rounding modes. */ fesetround(oround); - adj = r.lo + xy.lo; + /* work around clang bug 8100 */ + volatile double vrlo = r.lo; + adj = vrlo + xy.lo; return (ldexp(r.hi + adj, spread)); } Modified: head/lib/msun/src/s_fmal.c ============================================================================== --- head/lib/msun/src/s_fmal.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_fmal.c Mon May 27 08:50:10 2013 (r251024) @@ -226,6 +226,8 @@ fmal(long double x, long double y, long zs = copysignl(LDBL_MIN, zs); fesetround(FE_TONEAREST); + /* work around clang bug 8100 */ + volatile long double vxs = xs; /* * Basic approach for round-to-nearest: @@ -235,7 +237,7 @@ fmal(long double x, long double y, long * adj = xy.lo + r.lo (inexact; low bit is sticky) * result = r.hi + adj (correctly rounded) */ - xy = dd_mul(xs, ys); + xy = dd_mul(vxs, ys); r = dd_add(xy.hi, zs); spread = ex + ey; @@ -256,7 +258,9 @@ fmal(long double x, long double y, long * rounding modes. */ fesetround(oround); - adj = r.lo + xy.lo; + /* work around clang bug 8100 */ + volatile long double vrlo = r.lo; + adj = vrlo + xy.lo; return (ldexpl(r.hi + adj, spread)); } Modified: head/lib/msun/src/s_log1p.c ============================================================================== --- head/lib/msun/src/s_log1p.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_log1p.c Mon May 27 08:50:10 2013 (r251024) @@ -96,6 +96,7 @@ Lp6 = 1.531383769920937332e-01, /* 3FC3 Lp7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; +static volatile double vzero = 0.0; double log1p(double x) @@ -109,7 +110,7 @@ log1p(double x) k = 1; if (hx < 0x3FDA827A) { /* 1+x < sqrt(2)+ */ if(ax>=0x3ff00000) { /* x <= -1.0 */ - if(x==-1.0) return -two54/zero; /* log1p(-1)=+inf */ + if(x==-1.0) return -two54/vzero; /* log1p(-1)=+inf */ else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ } if(ax<0x3e200000) { /* |x| < 2**-29 */ Modified: head/lib/msun/src/s_log1pf.c ============================================================================== --- head/lib/msun/src/s_log1pf.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_log1pf.c Mon May 27 08:50:10 2013 (r251024) @@ -34,6 +34,7 @@ Lp6 = 1.5313838422e-01, /* 3E1CD04F */ Lp7 = 1.4798198640e-01; /* 3E178897 */ static const float zero = 0.0; +static volatile float vzero = 0.0; float log1pf(float x) @@ -47,7 +48,7 @@ log1pf(float x) k = 1; if (hx < 0x3ed413d0) { /* 1+x < sqrt(2)+ */ if(ax>=0x3f800000) { /* x <= -1.0 */ - if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=+inf */ + if(x==(float)-1.0) return -two25/vzero; /* log1p(-1)=+inf */ else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ } if(ax<0x38000000) { /* |x| < 2**-15 */ Modified: head/lib/msun/src/s_nearbyint.c ============================================================================== --- head/lib/msun/src/s_nearbyint.c Mon May 27 06:32:07 2013 (r251023) +++ head/lib/msun/src/s_nearbyint.c Mon May 27 08:50:10 2013 (r251024) @@ -36,12 +36,16 @@ __FBSDID("$FreeBSD$"); * instead of feclearexcept()/feupdateenv() to restore the environment * because the only exception defined for rint() is overflow, and * rounding can't overflow as long as emax >= p. + * + * The volatile keyword is needed below because clang incorrectly assumes + * that rint won't raise any floating-point exceptions. Declaring ret volatile + * is sufficient to trick the compiler into doing the right thing. */ #define DECL(type, fn, rint) \ type \ fn(type x) \ { \ - type ret; \ + volatile type ret; \ fenv_t env; \ \ fegetenv(&env); \ Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Mon May 27 06:32:07 2013 (r251023) +++ head/tools/regression/lib/msun/test-fma.c Mon May 27 08:50:10 2013 (r251024) @@ -77,6 +77,12 @@ __FBSDID("$FreeBSD$"); } while (0) /* + * This is needed because clang constant-folds fma in ways that are incorrect + * in rounding modes other than FE_TONEAREST. + */ +volatile double one = 1.0; + +/* * Determine whether x and y are equal, with two special rules: * +0.0 != -0.0 * NaN == NaN @@ -108,9 +114,9 @@ test_zeroes(void) testall(-0.0, 0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); testall(0.0, -0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); - testall(-1.0, 1.0, 1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); - testall(1.0, -1.0, 1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); - testall(-1.0, -1.0, -1.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(one, -one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, -one, -one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); switch (fegetround()) { case FE_TONEAREST: @@ -190,53 +196,53 @@ test_small_z(void) /* x*y positive, z positive */ if (fegetround() == FE_UPWARD) { - test(fmaf, 1.0, 1.0, 0x1.0p-100, 1.0 + FLT_EPSILON, + test(fmaf, one, one, 0x1.0p-100, 1.0 + FLT_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, 1.0, 1.0, 0x1.0p-200, 1.0 + DBL_EPSILON, + test(fma, one, one, 0x1.0p-200, 1.0 + DBL_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, 1.0, 1.0, 0x1.0p-200, 1.0 + LDBL_EPSILON, + test(fmal, one, one, 0x1.0p-200, 1.0 + LDBL_EPSILON, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, 1.0, 0x1.0p-100, 0x1.0p100, + testall(0x1.0p100, one, 0x1.0p-100, 0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y negative, z negative */ if (fegetround() == FE_DOWNWARD) { - test(fmaf, -1.0, 1.0, -0x1.0p-100, -(1.0 + FLT_EPSILON), + test(fmaf, -one, one, -0x1.0p-100, -(1.0 + FLT_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); - test(fma, -1.0, 1.0, -0x1.0p-200, -(1.0 + DBL_EPSILON), + test(fma, -one, one, -0x1.0p-200, -(1.0 + DBL_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, -1.0, 1.0, -0x1.0p-200, -(1.0 + LDBL_EPSILON), + test(fmal, -one, one, -0x1.0p-200, -(1.0 + LDBL_EPSILON), ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, -1.0, -0x1.0p-100, -0x1.0p100, + testall(0x1.0p100, -one, -0x1.0p-100, -0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y positive, z negative */ if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { - test(fmaf, 1.0, 1.0, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, + test(fmaf, one, one, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, 1.0, 1.0, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, + test(fma, one, one, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, 1.0, 1.0, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, + test(fmal, one, one, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(0x1.0p100, 1.0, -0x1.0p-100, 0x1.0p100, + testall(0x1.0p100, one, -0x1.0p-100, 0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } /* x*y negative, z positive */ if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { - test(fmaf, -1.0, 1.0, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, + test(fmaf, -one, one, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fma, -1.0, 1.0, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, + test(fma, -one, one, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); - test(fmal, -1.0, 1.0, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, + test(fmal, -one, one, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); } else { - testall(-0x1.0p100, 1.0, 0x1.0p-100, -0x1.0p100, + testall(-0x1.0p100, one, 0x1.0p-100, -0x1.0p100, ALL_STD_EXCEPT, FE_INEXACT); } } From owner-svn-src-head@FreeBSD.ORG Mon May 27 14:07:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84868C96; Mon, 27 May 2013 14:07:31 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC39677; Mon, 27 May 2013 14:07:31 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r4RE7M6k043624; Mon, 27 May 2013 07:07:22 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r4RE7MVk043623; Mon, 27 May 2013 07:07:22 -0700 (PDT) (envelope-from sgk) Date: Mon, 27 May 2013 07:07:22 -0700 From: Steve Kargl To: David Schultz Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Message-ID: <20130527140722.GA43583@troutmask.apl.washington.edu> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305270850.r4R8oA6g008947@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 14:07:31 -0000 On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: > Author: das > Date: Mon May 27 08:50:10 2013 > New Revision: 251024 > URL: http://svnweb.freebsd.org/changeset/base/251024 > > Log: > Fix some regressions caused by the switch from gcc to clang. The fixes > are workarounds for various symptoms of the problem described in clang > bugs 3929, 8100, 8241, 10409, and 12958. > > The regression tests did their job: they failed, someone brought it > up on the mailing lists, and then the issue got ignored for 6 months. > Oops. There may still be some regressions for functions we don't have > test coverage for yet. > The combination of clang+regression tests is almost unusable. % cd src/tools/regressions/lib/msun % make |& tee sgk.log % grep generated sgk.log 41 warnings generated. 1 warning generated. 1 warning generated. 593 warnings generated. 51 warnings generated. 1 warning generated. 221 warnings generated. 1 warning generated. 265 warnings generated. 84 warnings generated. 1 warning generated. 1 warning generated. 2 warnings generated. 74 warnings generated. I also find the following patch helpful in cleaning up the corefiles. Index: Makefile =================================================================== --- Makefile (revision 251026) +++ Makefile (working copy) @@ -12,4 +12,4 @@ .PHONY: clean clean: - -rm -f ${TESTS} + -rm -f ${TESTS} *.core -- Steve From owner-svn-src-head@FreeBSD.ORG Mon May 27 15:26:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AFE802C9; Mon, 27 May 2013 15:26:25 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id A3CDA9E1; Mon, 27 May 2013 15:26:24 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuwGAFt6o1FbsKBk/2dsb2JhbABagwgwwgWBBRd0giMBAQVWIgEQCw4GBAkWDwkDAgECASceBg0BBwEBiA0IvU+PDBEHg1QDj36BK4c7kBeDETo Received: from 100.160-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.160.100]) by relay.skynet.be with ESMTP; 27 May 2013 17:26:13 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r4RFQC5U003203; Mon, 27 May 2013 17:26:12 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51A37B0E.1010807@coosemans.org> Date: Mon, 27 May 2013 17:26:06 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: David Schultz Subject: Re: svn commit: r250990 - head/include References: <201305251855.r4PIttB7052695@svn.freebsd.org> <20130527083441.GA1309@zim.MIT.EDU> In-Reply-To: <20130527083441.GA1309@zim.MIT.EDU> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2REMGGGQRAXOEWXDKWVFM" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 15:26:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2REMGGGQRAXOEWXDKWVFM Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-05-27 10:34, David Schultz wrote: > On Sat, May 25, 2013, Ed Schouten wrote: >> Author: ed >> Date: Sat May 25 18:55:55 2013 >> New Revision: 250990 >> URL: http://svnweb.freebsd.org/changeset/base/250990 >> >> Log: >> Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). >> =20 >> Clang allows us to initialize complex numbers using an array >> initializer, casted to a complex type. GCC has a builtin called >> __builtin_complex(). >=20 > Awesome, thanks! I recall that we talked about this last year, and > the blocking issue was that gcc didn't support it. It appears > that the one in the base system still doesn't, but now that clang > is the default compiler, maybe that doesn't matter. >=20 > There are some regression tests in tools/regression/lib/msun that > could be converted to exercise these macros if you wish: grep for > "cpack". You could add a cpack-like fall-back for old gcc. It's not usable for static initialisation, but maybe it's better than nothing. #define CMPLX(x, y) __extension__({ double complex __z; \ __real__ __z =3D (x); __imag__ __z =3D (y); __z; }) ------enig2REMGGGQRAXOEWXDKWVFM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlGjexMACgkQfoCS2CCgtiuFwgD/bV7CvQcPpjpbgBmxw6MD9FWX D9O/H4h+xXxctU/nZgsA/jIeUD+RK+IR5UrEURH0BP02wFrMacxKGFuDvYdtv0m3 =K80O -----END PGP SIGNATURE----- ------enig2REMGGGQRAXOEWXDKWVFM-- From owner-svn-src-head@FreeBSD.ORG Mon May 27 17:23:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC0E4AAC; Mon, 27 May 2013 17:23:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 93BD1FC9; Mon, 27 May 2013 17:23:30 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4RHNQHJ006600; Mon, 27 May 2013 10:23:26 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4RHNQpB006599; Mon, 27 May 2013 10:23:26 -0700 (PDT) (envelope-from das@FreeBSD.org) Date: Mon, 27 May 2013 10:23:26 -0700 From: David Schultz To: Steve Kargl Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Message-ID: <20130527172326.GA6461@zim.MIT.EDU> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130527140722.GA43583@troutmask.apl.washington.edu> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 17:23:30 -0000 On Mon, May 27, 2013, Steve Kargl wrote: > On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: > > Author: das > > Date: Mon May 27 08:50:10 2013 > > New Revision: 251024 > > URL: http://svnweb.freebsd.org/changeset/base/251024 > > > > Log: > > Fix some regressions caused by the switch from gcc to clang. The fixes > > are workarounds for various symptoms of the problem described in clang > > bugs 3929, 8100, 8241, 10409, and 12958. > > > > The regression tests did their job: they failed, someone brought it > > up on the mailing lists, and then the issue got ignored for 6 months. > > Oops. There may still be some regressions for functions we don't have > > test coverage for yet. > > > > The combination of clang+regression tests is almost unusable. > > % cd src/tools/regressions/lib/msun > % make |& tee sgk.log > % grep generated sgk.log > 41 warnings generated. > 1 warning generated. > 1 warning generated. > 593 warnings generated. > 51 warnings generated. > 1 warning generated. > 221 warnings generated. > 1 warning generated. > 265 warnings generated. > 84 warnings generated. > 1 warning generated. > 1 warning generated. > 2 warnings generated. > 74 warnings generated. It seems that it's mostly complaining about the macros I use to test many variants of a function in a single call. The macros often say things like: assert(f(x) == y); \ assert(f, fetestexcept(...) == K); \ The goal of the "f, " is to make the failure message include the function that was invoked on the preceding line. The tests really shouldn't be using assert() at all. Starting circa 2002, I wrote them that way in the interests of expedience, since an official unit-testing framework was supposed to replace it anyway. Ten years later, it looks like everyone is still rolling their own! If someone were to write or import a good test framework, get all the tests to use it, and put together a test tinderbox, that would have a lot of impact. > I also find the following patch helpful in cleaning up the corefiles. > > > Index: Makefile > =================================================================== > --- Makefile (revision 251026) > +++ Makefile (working copy) > @@ -12,4 +12,4 @@ > > .PHONY: clean > clean: > - -rm -f ${TESTS} > + -rm -f ${TESTS} *.core Sounds reasonable. Feel free to commit this. From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:26:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34EA3344; Mon, 27 May 2013 18:26:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27F5E348; Mon, 27 May 2013 18:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIQ9vX004925; Mon, 27 May 2013 18:26:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIQ8IT004923; Mon, 27 May 2013 18:26:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271826.r4RIQ8IT004923@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251033 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:26:09 -0000 Author: kib Date: Mon May 27 18:26:08 2013 New Revision: 251033 URL: http://svnweb.freebsd.org/changeset/base/251033 Log: When handling an exception from the attempt from loading the faulting context on return from the trap handler, re-enable the interrupts on i386 and amd64. The trap return path have to disable interrupts since the sequence of loading the machine state is not atomic. The trap() function which transfers the control to the special handler would enable the interrupt, but an iret loads the previous eflags with PSL_I clear. Then, the special handler calls trap() on its own, which now sees the original eflags with PSL_I set and does not enable interrupts. The end result is that signal delivery and process exiting code could be executed with interrupts disabled, which is generally wrong and triggers several assertions. For amd64, the interrupts are enabled conditionally based on PSL_I in the eflags of the outer frame, as it is already done for doreti_iret_fault. For i386, the interrupts are enabled unconditionally, the ast loop could have opened a window with interrupts enabled just before the iret anyway. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/i386/i386/exception.s Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Mon May 27 16:29:53 2013 (r251032) +++ head/sys/amd64/amd64/exception.S Mon May 27 18:26:08 2013 (r251033) @@ -818,6 +818,10 @@ doreti_iret_fault: .globl ds_load_fault ds_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_DS(%rsp) @@ -827,6 +831,10 @@ ds_load_fault: .globl es_load_fault es_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUDSEL,TF_ES(%rsp) @@ -835,6 +843,10 @@ es_load_fault: ALIGN_TEXT .globl fs_load_fault fs_load_fault: + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movl $T_PROTFLT,TF_TRAPNO(%rsp) movq %rsp,%rdi call trap @@ -846,6 +858,10 @@ fs_load_fault: gs_load_fault: popfq movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movw $KUG32SEL,TF_GS(%rsp) @@ -855,6 +871,10 @@ gs_load_fault: .globl fsbase_load_fault fsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 @@ -866,6 +886,10 @@ fsbase_load_fault: .globl gsbase_load_fault gsbase_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) + testl $PSL_I,TF_RFLAGS(%rsp) + jz 1f + sti +1: movq %rsp,%rdi call trap movq PCPU(CURTHREAD),%r8 Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Mon May 27 16:29:53 2013 (r251032) +++ head/sys/i386/i386/exception.s Mon May 27 18:26:08 2013 (r251033) @@ -422,6 +422,7 @@ doreti_popl_es_fault: pushl %fs .globl doreti_popl_fs_fault doreti_popl_fs_fault: + sti movl $0,TF_ERR(%esp) /* XXX should be the error code */ movl $T_PROTFLT,TF_TRAPNO(%esp) jmp alltraps_with_regs_pushed From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:29:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E76D2705; Mon, 27 May 2013 18:29:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA46D363; Mon, 27 May 2013 18:29:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RITKUf005548; Mon, 27 May 2013 18:29:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RITK5q005547; Mon, 27 May 2013 18:29:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271829.r4RITK5q005547@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251035 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:29:21 -0000 Author: kib Date: Mon May 27 18:29:20 2013 New Revision: 251035 URL: http://svnweb.freebsd.org/changeset/base/251035 Log: When reporting the fault details, also print %rsp. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon May 27 18:27:12 2013 (r251034) +++ head/sys/amd64/amd64/trap.c Mon May 27 18:29:20 2013 (r251035) @@ -617,10 +617,10 @@ trap(struct trapframe *frame) ksi.ksi_addr = (void *)addr; if (uprintf_signal) { uprintf("pid %d comm %s: signal %d err %lx code %d type %d " - "addr 0x%lx rip 0x%lx " + "addr 0x%lx rsp 0x%lx rip 0x%lx " "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, - frame->tf_rip, + frame->tf_rsp, frame->tf_rip, fubyte((void *)(frame->tf_rip + 0)), fubyte((void *)(frame->tf_rip + 1)), fubyte((void *)(frame->tf_rip + 2)), From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:31:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 16563A44; Mon, 27 May 2013 18:31:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A019386; Mon, 27 May 2013 18:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIVFZ7007600; Mon, 27 May 2013 18:31:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIVFb9007599; Mon, 27 May 2013 18:31:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271831.r4RIVFb9007599@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251037 - head/sys/amd64/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:31:16 -0000 Author: kib Date: Mon May 27 18:31:15 2013 New Revision: 251037 URL: http://svnweb.freebsd.org/changeset/base/251037 Log: The ia32_get_mcontext() does not need to set PCB_FULL_IRET. The usermode context state is not changed by the get operation, and get_mcontext() does not require full iret as well. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:29:31 2013 (r251036) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:31:15 2013 (r251037) @@ -187,7 +187,6 @@ ia32_get_mcontext(struct thread *td, str mcp->mc_xfpustate = 0; mcp->mc_xfpustate_len = 0; bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:36:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DBA9FD16; Mon, 27 May 2013 18:36:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF3BB3E4; Mon, 27 May 2013 18:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIakir008584; Mon, 27 May 2013 18:36:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIakt4008582; Mon, 27 May 2013 18:36:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271836.r4RIakt4008582@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251038 - head/sys/amd64/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:36:46 -0000 Author: kib Date: Mon May 27 18:36:46 2013 New Revision: 251038 URL: http://svnweb.freebsd.org/changeset/base/251038 Log: The _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit value on purpose, but the ia32 context handling code is logically more correct to use the _MC_IA32_HASFPXSTATE name for the flag. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:31:15 2013 (r251037) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:36:46 2013 (r251038) @@ -112,7 +112,7 @@ ia32_get_fpcontext(struct thread *td, st len = max_len; bzero(xfpusave + max_len, len - max_len); } - mcp->mc_flags |= _MC_HASFPXSTATE; + mcp->mc_flags |= _MC_IA32_HASFPXSTATE; mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); } From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:39:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 367D7F4C; Mon, 27 May 2013 18:39:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 109215E6; Mon, 27 May 2013 18:39:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIddB6009093; Mon, 27 May 2013 18:39:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIddXQ009090; Mon, 27 May 2013 18:39:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271839.r4RIddXQ009090@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251039 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:39:40 -0000 Author: kib Date: Mon May 27 18:39:39 2013 New Revision: 251039 URL: http://svnweb.freebsd.org/changeset/base/251039 Log: Use slightly more idiomatic expression to get the address of array. Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/amd64/amd64/machdep.c Mon May 27 18:39:39 2013 (r251039) @@ -2278,7 +2278,7 @@ get_fpcontext(struct thread *td, mcontex size_t max_len, len; mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/amd64/ia32/ia32_signal.c Mon May 27 18:39:39 2013 (r251039) @@ -101,7 +101,7 @@ ia32_get_fpcontext(struct thread *td, st * for now, it should be irrelevant for most applications. */ mcp->mc_ownedfp = fpugetregs(td); - bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); if (!use_xsave || xfpusave_len == 0) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon May 27 18:36:46 2013 (r251038) +++ head/sys/i386/i386/machdep.c Mon May 27 18:39:39 2013 (r251039) @@ -3488,7 +3488,7 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif From owner-svn-src-head@FreeBSD.ORG Mon May 27 18:45:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEEDB335; Mon, 27 May 2013 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1CD662D; Mon, 27 May 2013 18:45:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RIjjxJ011728; Mon, 27 May 2013 18:45:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RIjjde011727; Mon, 27 May 2013 18:45:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305271845.r4RIjjde011727@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 May 2013 18:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251040 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 18:45:45 -0000 Author: kib Date: Mon May 27 18:45:45 2013 New Revision: 251040 URL: http://svnweb.freebsd.org/changeset/base/251040 Log: Partially apply the capitalization of the heading word of the sequence and fix typo. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon May 27 18:39:39 2013 (r251039) +++ head/lib/libthr/thread/thr_sig.c Mon May 27 18:45:45 2013 (r251040) @@ -205,9 +205,9 @@ handle_signal(struct sigaction *actp, in curthread->in_sigsuspend = 0; /* - * if thread is in deferred cancellation mode, disable cancellation + * If thread is in deferred cancellation mode, disable cancellation * in signal handler. - * if user signal handler calls a cancellation point function, e.g, + * If user signal handler calls a cancellation point function, e.g, * it calls write() to write data to file, because write() is a * cancellation point, the thread is immediately cancelled if * cancellation is pending, to avoid this problem while thread is in @@ -229,7 +229,7 @@ handle_signal(struct sigaction *actp, in * We have already reset cancellation point flags, so if user's code * longjmp()s out of its signal handler, wish its jmpbuf was set * outside of a cancellation point, in most cases, this would be - * true. however, ther is no way to save cancel_enable in jmpbuf, + * true. However, there is no way to save cancel_enable in jmpbuf, * so after setjmps() returns once more, the user code may need to * re-set cancel_enable flag by calling pthread_setcancelstate(). */ From owner-svn-src-head@FreeBSD.ORG Mon May 27 19:59:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FF88A4F; Mon, 27 May 2013 19:59:03 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) by mx1.freebsd.org (Postfix) with ESMTP id B9A6993F; Mon, 27 May 2013 19:59:02 +0000 (UTC) Received: by mail-oa0-f49.google.com with SMTP id k14so9241516oag.36 for ; Mon, 27 May 2013 12:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UbrEA/WpWXpaRKtMAt63r3kmQHeKdaLuAL5yf8BMCHI=; b=oTMMsSeNTHqHzb89opBns5uKpG79FqkcNibTk1S2F1CoHos/NbV+BxKrR6Yf0vClY8 yptaQ24sPEcNC+cBY2Gha/owEBI5auKF1r7x6npvDtZUEvSq3y7Y/ccCSZAvG9ZzUunj x2mLUmMFDtG5cOHZY4ky//ilCXzIPoo+FFNYrLJ2EuQ3GZmLttQmsBIhcBIM07o3rgpC CAQtDb5sd3VvD4G87blv0bLhz5Kmwm5G7mNPLbrb7J7mKnXZiwksU09ZmAVTvxBIyVvL XecG6LECWeMKNKjX8JKMn856Pg0nWNpnE89Dcj/1IFwqjifARVV/zkiYb5mv7vltEBts y8Ew== MIME-Version: 1.0 X-Received: by 10.60.155.209 with SMTP id vy17mr19593850oeb.83.1369684735089; Mon, 27 May 2013 12:58:55 -0700 (PDT) Received: by 10.76.90.10 with HTTP; Mon, 27 May 2013 12:58:55 -0700 (PDT) In-Reply-To: <20130527172326.GA6461@zim.MIT.EDU> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> <20130527172326.GA6461@zim.MIT.EDU> Date: Mon, 27 May 2013 15:58:55 -0400 Message-ID: Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun From: Ryan Stone To: David Schultz Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 19:59:03 -0000 On Mon, May 27, 2013 at 1:23 PM, David Schultz wrote: > If someone were to write or import a good test framework, > get all the tests to use it, and put together a test tinderbox, that > would have a lot of impact. > > People are working on bringing ATF into FreeBSD: https://wiki.freebsd.org/TestingFreeBSD From owner-svn-src-head@FreeBSD.ORG Mon May 27 20:01:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D0C7C4D; Mon, 27 May 2013 20:01:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9F795F; Mon, 27 May 2013 20:01:32 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B9F0F5C44; Mon, 27 May 2013 22:01:20 +0200 (CEST) Message-ID: <51A3BB8B.8020405@FreeBSD.org> Date: Mon, 27 May 2013 22:01:15 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Thunderbird/21.0 MIME-Version: 1.0 To: Steve Kargl , David Schultz Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> In-Reply-To: <20130527140722.GA43583@troutmask.apl.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 20:01:32 -0000 On 2013-05-27 16:07, Steve Kargl wrote: > On Mon, May 27, 2013 at 08:50:10AM +0000, David Schultz wrote: >> Author: das >> Date: Mon May 27 08:50:10 2013 >> New Revision: 251024 >> URL: http://svnweb.freebsd.org/changeset/base/251024 >> >> Log: >> Fix some regressions caused by the switch from gcc to clang. The fixes >> are workarounds for various symptoms of the problem described in clang >> bugs 3929, 8100, 8241, 10409, and 12958. >> >> The regression tests did their job: they failed, someone brought it >> up on the mailing lists, and then the issue got ignored for 6 months. >> Oops. There may still be some regressions for functions we don't have >> test coverage for yet. >> > > The combination of clang+regression tests is almost unusable. > > % cd src/tools/regressions/lib/msun > % make |& tee sgk.log > % grep generated sgk.log > 41 warnings generated. > 1 warning generated. > 1 warning generated. > 593 warnings generated. > 51 warnings generated. > 1 warning generated. > 221 warnings generated. > 1 warning generated. > 265 warnings generated. > 84 warnings generated. > 1 warning generated. > 1 warning generated. > 2 warnings generated. > 74 warnings generated. The following should help. Results in just a few warnings now, which may or may not be real bugs: 1 warning generated. 1 warning generated. 2 warnings generated. 1 warning generated. Index: tools/regression/lib/msun/Makefile =================================================================== --- tools/regression/lib/msun/Makefile (revision 250997) +++ tools/regression/lib/msun/Makefile (working copy) @@ -5,6 +5,7 @@ test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm +CFLAGS+= -Wno-unused-value -Wno-unknown-pragmas .PHONY: tests tests: ${TESTS} From owner-svn-src-head@FreeBSD.ORG Mon May 27 20:43:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CF28C6E; Mon, 27 May 2013 20:43:16 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C21ECB29; Mon, 27 May 2013 20:43:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RKhG63051038; Mon, 27 May 2013 20:43:16 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RKhGV4051036; Mon, 27 May 2013 20:43:16 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201305272043.r4RKhGV4051036@svn.freebsd.org> From: Steve Kargl Date: Mon, 27 May 2013 20:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251041 - head/lib/msun/ld80 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 20:43:16 -0000 Author: kargl Date: Mon May 27 20:43:16 2013 New Revision: 251041 URL: http://svnweb.freebsd.org/changeset/base/251041 Log: * Update polynomial coefficients. * Use ENTERI/RETURNI to allow the use of FP_PE on i386 target. Reviewed by: das (and bde a long time ago) Approved by: das (mentor) Obtained from: bde (polynomial coefficients) Modified: head/lib/msun/ld80/s_exp2l.c Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 18:45:45 2013 (r251040) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 20:43:16 2013 (r251041) @@ -36,25 +36,31 @@ __FBSDID("$FreeBSD$"); #include "fpmath.h" #include "math.h" +#include "math_private.h" #define TBLBITS 7 #define TBLSIZE (1 << TBLBITS) #define BIAS (LDBL_MAX_EXP - 1) -#define EXPMASK (BIAS + LDBL_MAX_EXP) static volatile long double huge = 0x1p10000L, twom10000 = 0x1p-10000L; +static const union IEEEl2bits +P1 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309429e-1L); + static const double - redux = 0x1.8p63 / TBLSIZE, - P1 = 0x1.62e42fefa39efp-1, - P2 = 0x1.ebfbdff82c58fp-3, - P3 = 0x1.c6b08d7049fap-5, - P4 = 0x1.3b2ab6fba4da5p-7, - P5 = 0x1.5d8804780a736p-10, - P6 = 0x1.430918835e33dp-13; +redux = 0x1.8p63 / TBLSIZE, +/* + * Domain [-0.00390625, 0.00390625], range ~[-1.7079e-23, 1.7079e-23] + * |exp(x) - p(x)| < 2**-75.6 + */ +P2 = 2.4022650695910072e-1, /* 0x1ebfbdff82c58f.0p-55 */ +P3 = 5.5504108664816879e-2, /* 0x1c6b08d7049e1a.0p-57 */ +P4 = 9.6181291055695180e-3, /* 0x13b2ab6fa8321a.0p-59 */ +P5 = 1.3333563089183052e-3, /* 0x15d8806f67f251.0p-62 */ +P6 = 1.5413361552277414e-4; /* 0x1433ddacff3441.0p-65 */ static const double tbl[TBLSIZE * 2] = { 0x1.6a09e667f3bcdp-1, -0x1.bdd3413b2648p-55, @@ -187,8 +193,8 @@ static const double tbl[TBLSIZE * 2] = { 0x1.68155d44ca973p+0, 0x1.038ae44f74p-57, }; -/* - * exp2l(x): compute the base 2 exponential of x +/*- + * Compute the base 2 exponential of x for Intel 80-bit format. * * Accuracy: Peak error < 0.511 ulp. * @@ -204,7 +210,7 @@ static const double tbl[TBLSIZE * 2] = { * with |z| <= 2**-(TBLBITS+1). * * We compute exp2(i/TBLSIZE) via table lookup and exp2(z) via a - * degree-6 minimax polynomial with maximum error under 2**-69. + * degree-6 minimax polynomial with maximum error under 2**-75.6. * The table entries each have 104 bits of accuracy, encoded as * a pair of double precision values. */ @@ -219,30 +225,22 @@ exp2l(long double x) /* Filter out exceptional cases. */ u.e = x; hx = u.xbits.expsign; - ix = hx & EXPMASK; + ix = hx & 0x7fff; if (ix >= BIAS + 14) { /* |x| >= 16384 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { - if (u.xbits.man != 1ULL << 63 || (hx & 0x8000) == 0) - return (x + x); /* x is +Inf or NaN */ - else - return (0.0); /* x is -Inf */ + if (hx & 0x8000 && u.xbits.man == 1ULL << 63) + return (0.0L); /* x is -Inf */ + return (x + x); /* x is +Inf, NaN or unsupported */ } if (x >= 16384) return (huge * huge); /* overflow */ if (x <= -16446) return (twom10000 * twom10000); /* underflow */ - } else if (ix <= BIAS - 66) { /* |x| < 0x1p-66 */ - return (1.0 + x); + } else if (ix <= BIAS - 66) { /* |x| < 0x1p-65 (includes pseudos) */ + return (1.0L + x); /* 1 with inexact */ } -#ifdef __i386__ - /* - * The default precision on i386 is 53 bits, so long doubles are - * broken. Call exp2() to get an accurate (double precision) result. - */ - if (fpgetprec() != FP_PE) - return (exp2(x)); -#endif + ENTERI(); /* * Reduce x, computing z, i0, and k. The low bits of x + redux @@ -266,26 +264,25 @@ exp2l(long double x) z = x - u.e; v.xbits.man = 1ULL << 63; if (k >= LDBL_MIN_EXP) { - v.xbits.expsign = LDBL_MAX_EXP - 1 + k; + v.xbits.expsign = BIAS + k; twopk = v.e; } else { - v.xbits.expsign = LDBL_MAX_EXP - 1 + k + 10000; + v.xbits.expsign = BIAS + k + 10000; twopkp10000 = v.e; } /* Compute r = exp2l(y) = exp2lt[i0] * p(z). */ long double t_hi = tbl[i0]; long double t_lo = tbl[i0 + 1]; - /* XXX This gives > 1 ulp errors outside of FE_TONEAREST mode */ - r = t_lo + (t_hi + t_lo) * z * (P1 + z * (P2 + z * (P3 + z * (P4 + r = t_lo + (t_hi + t_lo) * z * (P1.e + z * (P2 + z * (P3 + z * (P4 + z * (P5 + z * P6))))) + t_hi; /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - return (r * 2.0 * 0x1p16383L); - return (r * twopk); + RETURNI(r * 2.0 * 0x1p16383L); + RETURNI(r * twopk); } else { - return (r * twopkp10000 * twom10000); + RETURNI(r * twopkp10000 * twom10000); } } From owner-svn-src-head@FreeBSD.ORG Mon May 27 21:37:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB53116A; Mon, 27 May 2013 21:37:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDCDBE85; Mon, 27 May 2013 21:37:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RLbJ7f068129; Mon, 27 May 2013 21:37:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RLbJK0068128; Mon, 27 May 2013 21:37:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305272137.r4RLbJK0068128@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 27 May 2013 21:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251042 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 21:37:20 -0000 Author: jilles Date: Mon May 27 21:37:19 2013 New Revision: 251042 URL: http://svnweb.freebsd.org/changeset/base/251042 Log: cap_rights_limit(2): CAP_ACCEPT also permits accept4(2). Modified: head/lib/libc/sys/cap_rights_limit.2 Modified: head/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- head/lib/libc/sys/cap_rights_limit.2 Mon May 27 20:43:16 2013 (r251041) +++ head/lib/libc/sys/cap_rights_limit.2 Mon May 27 21:37:19 2013 (r251042) @@ -77,7 +77,9 @@ The following rights may be specified in .Bl -tag -width CAP_EXTATTR_DELETE .It Dv CAP_ACCEPT Permit -.Xr accept 2 . +.Xr accept 2 +and +.Xr accept4 2 . .It Dv CAP_ACL_CHECK Permit checking of an ACL on a file descriptor; there is no cross-reference for this system call. From owner-svn-src-head@FreeBSD.ORG Mon May 27 22:19:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7EE5FF9; Mon, 27 May 2013 22:19:02 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 88696D2; Mon, 27 May 2013 22:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMJ265081631; Mon, 27 May 2013 22:19:02 GMT (envelope-from gad@svn.freebsd.org) Received: (from gad@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMJ2lL081629; Mon, 27 May 2013 22:19:02 GMT (envelope-from gad@svn.freebsd.org) Message-Id: <201305272219.r4RMJ2lL081629@svn.freebsd.org> From: Garance A Drosehn Date: Mon, 27 May 2013 22:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251044 - head/usr.sbin/lpr/common_source X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 22:19:02 -0000 Author: gad Date: Mon May 27 22:19:01 2013 New Revision: 251044 URL: http://svnweb.freebsd.org/changeset/base/251044 Log: Change the closeallfds() routine to use closefrom() when it is available (closefrom() was added to FreeBSD in 8.0-release). The selection is made at compile-time, as I still compile a FreeBSD-based version of lpr&friends on other platforms. While testing I out that (at least on my system) lpd has been closing 11095 fd's, when there are only 6 fd's open. The old code took 120 times more clocktime than calling closefrom(). (although that was still less than 2/1000-ths of a second!) Reviewed by: jilles MFC after: 2 weeks Modified: head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/common_source/lp.cdefs.h Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Mon May 27 22:18:04 2013 (r251043) +++ head/usr.sbin/lpr/common_source/common.c Mon May 27 22:19:01 2013 (r251044) @@ -757,16 +757,22 @@ fatal(const struct printer *pp, const ch /* * Close all file descriptors from START on up. - * This is a horrific kluge, since getdtablesize() might return - * ``infinity'', in which case we will be spending a long time - * closing ``files'' which were never open. Perhaps it would - * be better to close the first N fds, for some small value of N. */ void closeallfds(int start) { - int stop = getdtablesize(); - for (; start < stop; start++) - close(start); + int stop; + + if (USE_CLOSEFROM) /* The faster, modern solution */ + closefrom(start); + else { + /* This older logic can be pretty awful on some OS's. The + * getdtablesize() might return ``infinity'', and then this + * will waste a lot of time closing file descriptors which + * had never been open()-ed. */ + stop = getdtablesize(); + for (; start < stop; start++) + close(start); + } } Modified: head/usr.sbin/lpr/common_source/lp.cdefs.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.cdefs.h Mon May 27 22:18:04 2013 (r251043) +++ head/usr.sbin/lpr/common_source/lp.cdefs.h Mon May 27 22:19:01 2013 (r251044) @@ -1,6 +1,6 @@ /*- * ------+---------+---------+---------+---------+---------+---------+---------* - * Copyright (c) 2003 - Garance Alistair Drosehn . + * Copyright (c) 2003,2013 - Garance Alistair Drosehn . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,21 @@ #endif /* + * FreeBSD added a closefrom() routine in release 8.0. When compiling + * `lpr' on other platforms you might want to include bsd-closefrom.c + * from the portable-openssh project. + */ +#ifndef USE_CLOSEFROM +# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# define USE_CLOSEFROM 1 +# endif +#endif +/* The macro USE_CLOSEFROM must be defined with a value of 0 or 1. */ +#ifndef USE_CLOSEFROM +# define USE_CLOSEFROM 0 +#endif + +/* * __unused is a compiler-specific trick which can be used to avoid * warnings about a variable which is defined but never referenced. * Some lpr files use this, so define a null version if it was not From owner-svn-src-head@FreeBSD.ORG Mon May 27 22:45:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 932B0771; Mon, 27 May 2013 22:45:05 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85936198; Mon, 27 May 2013 22:45:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMj5QL090957; Mon, 27 May 2013 22:45:05 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMj5Q7090956; Mon, 27 May 2013 22:45:05 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201305272245.r4RMj5Q7090956@svn.freebsd.org> From: Steve Kargl Date: Mon, 27 May 2013 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251046 - head/lib/msun/ld80 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 27 May 2013 22:45:05 -0000 Author: kargl Date: Mon May 27 22:45:05 2013 New Revision: 251046 URL: http://svnweb.freebsd.org/changeset/base/251046 Log: Style(9) Approved by: das (implicit) Reported by: jh Modified: head/lib/msun/ld80/s_exp2l.c Modified: head/lib/msun/ld80/s_exp2l.c ============================================================================== --- head/lib/msun/ld80/s_exp2l.c Mon May 27 22:41:43 2013 (r251045) +++ head/lib/msun/ld80/s_exp2l.c Mon May 27 22:45:05 2013 (r251046) @@ -193,7 +193,7 @@ static const double tbl[TBLSIZE * 2] = { 0x1.68155d44ca973p+0, 0x1.038ae44f74p-57, }; -/*- +/** * Compute the base 2 exponential of x for Intel 80-bit format. * * Accuracy: Peak error < 0.511 ulp. From owner-svn-src-head@FreeBSD.ORG Tue May 28 02:01:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B6454CB; Tue, 28 May 2013 02:01:24 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1.freebsd.org (Postfix) with ESMTP id 152F7E24; Tue, 28 May 2013 02:01:23 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id tj12so2396630pac.18 for ; Mon, 27 May 2013 19:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=rtu7KhvG2zqRnUaiWcsfV9RfRdGY3Kfab7DcJhMouZQ=; b=ob193KOiOde8iobEAkFyFHTCX2SpRFedp14l2jZAcG43Ut4dsJKdsIRk71NGp/fsbE GgHAXHHM3DTRkUxDlBfViW1ciSV741tJ19aSFMyHDLGUT+vPBQm6EzFfaNfceUoJQMF8 k2PW+Sfi1wJJTddnqzyy/GIVWC94tGhioit5gh/8f0ClCyg49gMhnqcId42b4Due4ov/ ZuFfHto9WoYo4meV6SVgpv4+mqgq6G7KtO2wsIuM9g6JNagF6Apce9Tnrkn/4y8cgU3F VqrdMP12YsEZjU+tyIVFiu7A4Bf0BXA5YWIGZVoF6TCyPA/ZL5h/FADwGhW4RDGhESLL 1OZQ== X-Received: by 10.68.180.4 with SMTP id dk4mr31569006pbc.104.1369706476396; Mon, 27 May 2013 19:01:16 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id lq4sm32825690pab.19.2013.05.27.19.01.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 19:01:14 -0700 (PDT) Subject: Re: svn commit: r251024 - in head: lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/src tools/regression/lib/msun Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: Date: Mon, 27 May 2013 19:01:12 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <13D68565-6ED3-44F2-82A9-E94F53C6C95A@gmail.com> References: <201305270850.r4R8oA6g008947@svn.freebsd.org> <20130527140722.GA43583@troutmask.apl.washington.edu> <20130527172326.GA6461@zim.MIT.EDU> To: Ryan Stone X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, svn-src-all@freebsd.org, Steve Kargl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 02:01:24 -0000 On May 27, 2013, at 12:58 PM, Ryan Stone wrote: > On Mon, May 27, 2013 at 1:23 PM, David Schultz = wrote: >=20 >> If someone were to write or import a good test framework, >> get all the tests to use it, and put together a test tinderbox, that >> would have a lot of impact. >>=20 >>=20 > People are working on bringing ATF into FreeBSD: >=20 > https://wiki.freebsd.org/TestingFreeBSD Thanks for the plug! Yes, ATF is in (it's a bit outdated so I'll have to submit a patch for = ATF 0.17), build infrastructure's on its way, and the best news of all = is that I've already ported a large chunk of the msun testcases from = NetBSD to FreeBSD. They work with little hacking for the most part. = Example: # cd /usr/src/lib/msun/tests/ # make obj depend all check Summary for 19 test programs: 295 passed test cases. 0 failed test cases. 0 expected failed test cases. 5 skipped test cases. *** The verbatim output of atf-run has been saved to = /usr/obj/usr/src/lib/msun/tests/atf-run.log # Why isn't this in FreeBSD yet (along with some of the other testsuites = from NetBSD)? Well, a couple of reasons: 1. The test build infrastructure changes haven't been fully pushed in = (Marcel's helping me out with the latest set of patches). 2. There are issues with porting stuff over from NetBSD because some of = the macros needed to minimize porting divergence don't have a happy home = yet. I gently poked several people from FreeBSD, NetBSD, and OpenBSD = about getting some degree of solidarity and agreement on macros, but I = haven't heard back from anyone I emailed for several weeks. So I figure = that FreeBSD needs to bend by adding some [compat] macros to strategic = locations in sys/sys, and then we can work on standardizing things = later. I really don't want to hack all of the tests to use libnetbsd = because while it works for nmtree and nmakefs, it doesn't make sense for = testcases as the volume of required changes wouldn't make sense from a = porting perspective. 3. I really REALLY need help porting over changes we've added that can = be contributed back to NetBSD, and FreeBSD specific tests need to be = cordoned off properly. As far as the test image stuff is concerned and test tinderbox stuff is = concerned, yes, it's on my radar.. I'm working on installing tests via = .iso images and USB images; once that's done we can work on making the = other testing stuff work on a cron basis via tinderbox or another = similar mechanism. So, what say ye to making things work better and helping me in this = process :)? Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Tue May 28 04:54:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67F4E3CF; Tue, 28 May 2013 04:54:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49B627FB; Tue, 28 May 2013 04:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S4sJkA014292; Tue, 28 May 2013 04:54:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S4sHHn014272; Tue, 28 May 2013 04:54:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280454.r4S4sHHn014272@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 04:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251047 - in head: lib/libc/amd64/gen lib/libc/arm/gen lib/libc/gen lib/libc/i386/gen lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sparc64/ge... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 04:54:19 -0000 Author: kib Date: Tue May 28 04:54:16 2013 New Revision: 251047 URL: http://svnweb.freebsd.org/changeset/base/251047 Log: The getcontext() from the __fillcontextx() call in the check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Modified: head/lib/libc/amd64/gen/getcontextx.c head/lib/libc/arm/gen/getcontextx.c head/lib/libc/gen/Symbol.map head/lib/libc/i386/gen/getcontextx.c head/lib/libc/ia64/gen/getcontextx.c head/lib/libc/mips/gen/getcontextx.c head/lib/libc/powerpc/gen/getcontextx.c head/lib/libc/powerpc64/gen/getcontextx.c head/lib/libc/sparc64/gen/getcontextx.c head/lib/libthr/thread/thr_sig.c head/sys/sys/ucontext.h Modified: head/lib/libc/amd64/gen/getcontextx.c ============================================================================== --- head/lib/libc/amd64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/amd64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -57,14 +57,12 @@ __getcontextx_size(void) } int -__fillcontextx(char *ctx) +__fillcontextx2(char *ctx) { struct amd64_get_xfpustate xfpu; ucontext_t *ucp; ucp = (ucontext_t *)ctx; - if (getcontext(ucp) == -1) - return (-1); if (xstate_sz != 0) { xfpu.addr = (char *)(ucp + 1); xfpu.len = xstate_sz; @@ -80,6 +78,18 @@ __fillcontextx(char *ctx) return (0); } +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + __weak_reference(__getcontextx, getcontextx); ucontext_t * Modified: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- head/lib/libc/arm/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/arm/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/gen/Symbol.map Tue May 28 04:54:16 2013 (r251047) @@ -529,5 +529,6 @@ FBSDprivate_1.0 { __elf_aux_vector; __pthread_map_stacks_exec; __fillcontextx; + __fillcontextx2; __getcontextx_size; }; Modified: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- head/lib/libc/i386/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/i386/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -89,14 +89,12 @@ __getcontextx_size(void) } int -__fillcontextx(char *ctx) +__fillcontextx2(char *ctx) { struct i386_get_xfpustate xfpu; ucontext_t *ucp; ucp = (ucontext_t *)ctx; - if (getcontext(ucp) == -1) - return (-1); if (xstate_sz != 0) { xfpu.addr = (char *)(ucp + 1); xfpu.len = xstate_sz; @@ -112,6 +110,18 @@ __fillcontextx(char *ctx) return (0); } +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + __weak_reference(__getcontextx, getcontextx); ucontext_t * Modified: head/lib/libc/ia64/gen/getcontextx.c ============================================================================== --- head/lib/libc/ia64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/ia64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/mips/gen/getcontextx.c ============================================================================== --- head/lib/libc/mips/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/mips/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/powerpc/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/powerpc/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/powerpc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/powerpc64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libc/sparc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/sparc64/gen/getcontextx.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libc/sparc64/gen/getcontextx.c Tue May 28 04:54:16 2013 (r251047) @@ -40,6 +40,13 @@ __getcontextx_size(void) } int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int __fillcontextx(char *ctx) { ucontext_t *ucp; Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon May 27 22:45:05 2013 (r251046) +++ head/lib/libthr/thread/thr_sig.c Tue May 28 04:54:16 2013 (r251047) @@ -323,8 +323,13 @@ check_deferred_signal(struct pthread *cu return; #if defined(__amd64__) || defined(__i386__) - uc = alloca(__getcontextx_size()); - __fillcontextx((char *)uc); + int uc_len; + uc_len = __getcontextx_size(); + uc = alloca(uc_len); + getcontext(uc); + if (curthread->deferred_siginfo.si_signo == 0) + return; + __fillcontextx2((char *)uc); #else ucontext_t ucv; uc = &ucv; Modified: head/sys/sys/ucontext.h ============================================================================== --- head/sys/sys/ucontext.h Mon May 27 22:45:05 2013 (r251046) +++ head/sys/sys/ucontext.h Tue May 28 04:54:16 2013 (r251047) @@ -80,7 +80,8 @@ int swapcontext(ucontext_t *, const ucon #if __BSD_VISIBLE int __getcontextx_size(void); -int __fillcontextx(char *ctx); +int __fillcontextx(char *ctx) __returns_twice; +int __fillcontextx2(char *ctx); #endif __END_DECLS From owner-svn-src-head@FreeBSD.ORG Tue May 28 08:50:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EF0080E; Tue, 28 May 2013 08:50:51 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF523F7; Tue, 28 May 2013 08:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S8opMe092586; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S8opvu092585; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201305280850.r4S8opvu092585@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 May 2013 08:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251053 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 08:50:51 -0000 Author: tijl Date: Tue May 28 08:50:50 2013 New Revision: 251053 URL: http://svnweb.freebsd.org/changeset/base/251053 Log: Fix cexp regression tests that have an infinite real part. The signs of the result depend on the cosine and sine of the imaginary part. Small values are used in the new tests such that cosine and sine are well defined. Reviewed by: das Modified: head/tools/regression/lib/msun/test-cexp.c Modified: head/tools/regression/lib/msun/test-cexp.c ============================================================================== --- head/tools/regression/lib/msun/test-cexp.c Tue May 28 05:52:03 2013 (r251052) +++ head/tools/regression/lib/msun/test-cexp.c Tue May 28 08:50:50 2013 (r251053) @@ -110,7 +110,7 @@ cpackl(long double x, long double y) /* Various finite non-zero numbers to test. */ static const float finites[] = -{ -42.0e20, -1.0 -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; +{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; /* * Determine whether x and y are equal, with two special rules: @@ -228,21 +228,35 @@ test_inf(void) int i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ - /* cexp(inf + yi) = 0 + 0yi */ - /* cexp(-inf + yi) = inf + inf yi (except y=0) */ for (i = 0; i < N(finites); i++) { testall(cpackl(finites[i], INFINITY), cpackl(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); - /* XXX shouldn't raise an inexact exception */ - testall(cpackl(-INFINITY, finites[i]), - cpackl(0.0, 0.0 * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - if (finites[i] == 0) - continue; - testall(cpackl(INFINITY, finites[i]), - cpackl(INFINITY, INFINITY * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } + /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(-INFINITY, M_PI_4), cpackl(0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 3 * M_PI_4), cpackl(-0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 5 * M_PI_4), cpackl(-0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 7 * M_PI_4), cpackl(0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 0.0), cpackl(0.0, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(cpackl(-INFINITY, -0.0), cpackl(0.0, -0.0), + ALL_STD_EXCEPT, 0, 1); + /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(INFINITY, M_PI_4), cpackl(INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 3 * M_PI_4), cpackl(-INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 5 * M_PI_4), cpackl(-INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 7 * M_PI_4), cpackl(INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + /* cexp(inf + 0i) = inf + 0i */ testall(cpackl(INFINITY, 0.0), cpackl(INFINITY, 0.0), ALL_STD_EXCEPT, 0, 1); testall(cpackl(INFINITY, -0.0), cpackl(INFINITY, -0.0), From owner-svn-src-head@FreeBSD.ORG Tue May 28 09:25:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4697DE18; Tue, 28 May 2013 09:25:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DDAD775; Tue, 28 May 2013 09:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9PwhR003513; Tue, 28 May 2013 09:25:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9PwGM003512; Tue, 28 May 2013 09:25:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201305280925.r4S9PwGM003512@svn.freebsd.org> From: Michael Tuexen Date: Tue, 28 May 2013 09:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251054 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 09:25:59 -0000 Author: tuexen Date: Tue May 28 09:25:58 2013 New Revision: 251054 URL: http://svnweb.freebsd.org/changeset/base/251054 Log: Remove redundant checks. MFC after: 2 weeks Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue May 28 08:50:50 2013 (r251053) +++ head/sys/netinet/sctputil.c Tue May 28 09:25:58 2013 (r251054) @@ -3536,8 +3536,8 @@ sctp_ulp_notify(uint32_t notification, s if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if (stcb && ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED))) { + if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || + (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3611,16 +3611,16 @@ sctp_ulp_notify(uint32_t notification, s 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))) { + if (((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, 0, so_locked); } else { 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))) { + if (((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); From owner-svn-src-head@FreeBSD.ORG Tue May 28 09:33:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3BCA385; Tue, 28 May 2013 09:33:46 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC63D7CE; Tue, 28 May 2013 09:33:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9XkaQ006675; Tue, 28 May 2013 09:33:46 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9XktD006673; Tue, 28 May 2013 09:33:46 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201305280933.r4S9XktD006673@svn.freebsd.org> From: Joel Dahl Date: Tue, 28 May 2013 09:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251056 - in head: share/man/man4 tools/tools/makeroot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 09:33:47 -0000 Author: joel (doc committer) Date: Tue May 28 09:33:46 2013 New Revision: 251056 URL: http://svnweb.freebsd.org/changeset/base/251056 Log: mdoc: silence a few mandoc lint warnings. Modified: head/share/man/man4/aacraid.4 head/tools/tools/makeroot/makeroot.8 Modified: head/share/man/man4/aacraid.4 ============================================================================== --- head/share/man/man4/aacraid.4 Tue May 28 09:26:48 2013 (r251055) +++ head/share/man/man4/aacraid.4 Tue May 28 09:33:46 2013 (r251056) @@ -53,10 +53,10 @@ The driver provides support for the Adaptec by PMC RAID controllers, including Series 6/7/8 and upcoming families. .Pp -The RAID containers are handled via the +The RAID containers are handled via the .Nm aacraidp0 bus. -The physical buses are represented by the +The physical buses are represented by the .Nm aacraidp? devices (beginning with aacraidp1). These devices enable the SCSI pass-thru interface and allows devices connected @@ -135,5 +135,4 @@ and are also queued for retrieval by a m .An Scott Long .Aq scottl@FreeBSD.org .Sh BUGS -.Pp The controller is not actually paused on suspend/resume. Modified: head/tools/tools/makeroot/makeroot.8 ============================================================================== --- head/tools/tools/makeroot/makeroot.8 Tue May 28 09:26:48 2013 (r251055) +++ head/tools/tools/makeroot/makeroot.8 Tue May 28 09:33:46 2013 (r251056) @@ -108,8 +108,6 @@ The argument is passed directly to .Xr makefs 8 . .El -.Sh EXAMPLES -.Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist .Sh FILES .Bl -tag -width METALOG -compact .It Pa METALOG @@ -118,6 +116,8 @@ argument is passed directly to directory. This file is generated by installworld, distribution, and installkernel. .El +.Sh EXAMPLES +.Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist .Sh SEE ALSO .Xr mtree 5 , .Xr makefs 8 , From owner-svn-src-head@FreeBSD.ORG Tue May 28 09:52:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA5D9C26; Tue, 28 May 2013 09:52:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2468D5; Tue, 28 May 2013 09:52:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9qSor012992; Tue, 28 May 2013 09:52:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9qShX012991; Tue, 28 May 2013 09:52:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305280952.r4S9qShX012991@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 28 May 2013 09:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251058 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 09:52:28 -0000 Author: des Date: Tue May 28 09:52:28 2013 New Revision: 251058 URL: http://svnweb.freebsd.org/changeset/base/251058 Log: During buildkernel, print a banner before building modules. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) @@ -983,9 +983,16 @@ buildkernel: .endif @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 3.2: building everything" + @echo ">>> stage 3.2: building the kernel" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ + @echo +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) + @echo "--------------------------------------------------------------" + @echo ">>> stage 3.3: building the modules" + @echo "--------------------------------------------------------------" + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ +.endif @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Tue May 28 13:54:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71459D38; Tue, 28 May 2013 13:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63F61D2E; Tue, 28 May 2013 13:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SDsRFD091294; Tue, 28 May 2013 13:54:27 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SDsRkx091293; Tue, 28 May 2013 13:54:27 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305281354.r4SDsRkx091293@svn.freebsd.org> From: Mark Johnston Date: Tue, 28 May 2013 13:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251059 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 13:54:27 -0000 Author: markj Date: Tue May 28 13:54:26 2013 New Revision: 251059 URL: http://svnweb.freebsd.org/changeset/base/251059 Log: - Fix wording. [1] - Improve the descriptions in the FILES section. [2] Reported by: Jason McIntyre [1] Obtained from: NetBSD [2] MFC after: 3 days Modified: head/usr.sbin/rtsold/rtsold.8 Modified: head/usr.sbin/rtsold/rtsold.8 ============================================================================== --- head/usr.sbin/rtsold/rtsold.8 Tue May 28 09:52:28 2013 (r251058) +++ head/usr.sbin/rtsold/rtsold.8 Tue May 28 13:54:26 2013 (r251059) @@ -161,9 +161,9 @@ will dump the current internal state int The options are as follows: .Bl -tag -width indent .It Fl a -Autoprobe outgoing interface. +Autoprobe outgoing interfaces. .Nm -will try to find non-loopback, non-point-to-point, IPv6-capable interfaces +will try to find any non-loopback, non-point-to-point, IPv6-capable interfaces and send router solicitation messages on all of them. .It Fl d Enable debugging. @@ -256,10 +256,10 @@ If not, it will be .Sh FILES .Bl -tag -width /var/run/rtsold.dump -compact .It Pa /var/run/rtsold.pid -the pid of the currently running +The PID of the currently running .Nm . .It Pa /var/run/rtsold.dump -dumps internal state on. +Internal state dump file. .El .\" .Sh EXIT STATUS From owner-svn-src-head@FreeBSD.ORG Tue May 28 14:44:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4FCA2A4; Tue, 28 May 2013 14:44:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B73EFF90; Tue, 28 May 2013 14:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SEibx5009524; Tue, 28 May 2013 14:44:37 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SEibkS009522; Tue, 28 May 2013 14:44:37 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305281444.r4SEibkS009522@svn.freebsd.org> From: Steven Hartland Date: Tue, 28 May 2013 14:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251061 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 14:44:37 -0000 Author: smh Date: Tue May 28 14:44:37 2013 New Revision: 251061 URL: http://svnweb.freebsd.org/changeset/base/251061 Log: Added missing SCSI quirks from r241784 Re-ordered SSD quirks alphabetically so they are easier to maintain. Removed my email and PR reference from comments on each quirk. Added quirks for more SSDs: * Crucial M4 * Corsair Force GT * Intel 520 Series * Kingston E100 Series * Samsung 830 Series Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue May 28 14:32:02 2013 (r251060) +++ head/sys/cam/ata/ata_da.c Tue May 28 14:44:37 2013 (r251061) @@ -272,12 +272,11 @@ static struct ada_quirk_entry ada_quirk_ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD?????PVT*", "*" }, /*quirks*/ADA_Q_4K }, + /* SSDs */ { /* * Corsair Force 2 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair CSSD-F*", "*" }, /*quirks*/ADA_Q_4K @@ -286,116 +285,136 @@ static struct ada_quirk_entry ada_quirk_ /* * Corsair Force 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force 3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Agility 3 SSDs + * Corsair Force GT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force GT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 2 SSDs (inc pro series) + * Crucial M4 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "M4-CT???M4SSD2*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * OCZ Vertex 3 SSDs + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/ADA_Q_4K + }, + { + /* + * Intel 320 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * SuperTalent TeraDrive CT SSDs + * Intel 330 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2CT*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Crucial RealSSD C300 SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", - "*" }, /*quirks*/ADA_Q_4K + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + /*quirks*/ADA_Q_4K }, { /* - * XceedIOPS SATA SSDs - * 4k optimised - * Submitted by: Steven Hartland - * PR: 169974 + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BW*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 320 Series SSDs + * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SE100S3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 330 Series SSDs + * Kingston HyperX 3k SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2ct*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Intel 510 Series SSDs + * OCZ Agility 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, /*quirks*/ADA_Q_4K }, { /* * OCZ Deneva R Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "DENRSTE251M45*", "*" }, /*quirks*/ADA_Q_4K }, { /* - * Kingston HyperX 3k SSDs + * OCZ Vertex 2 SSDs (inc pro series) * 4k optimised & trim only works in 4k requests + 4k aligned - * Submitted by: Steven Hartland - * PR: 169974 */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, /*quirks*/ADA_Q_4K }, { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue May 28 14:32:02 2013 (r251060) +++ head/sys/cam/scsi/scsi_da.c Tue May 28 14:44:37 2013 (r251061) @@ -907,6 +907,151 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HM250JI", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + /* SATA SSDs */ + { + /* + * Corsair Force 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair CSSD-F*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force 3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Corsair Force GT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force GT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial M4 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "M4-CT???M4SSD2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Crucial RealSSD C300 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/DA_Q_4K + }, + { + /* + * Intel 320 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSA2CW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 330 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2CT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2MH*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Intel 520 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BW*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston E100 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SE100S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "KINGSTON SH103S3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-AGILITY3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Deneva R Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "DENRSTE251M45*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 2 SSDs (inc pro series) + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ?VERTEX2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung 830 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG SSD 830 Series*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "FTM??CT25H*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, + /*quirks*/DA_Q_4K + }, }; static disk_strategy_t dastrategy; From owner-svn-src-head@FreeBSD.ORG Tue May 28 17:58:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5545133E; Tue, 28 May 2013 17:58:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 32050B5A; Tue, 28 May 2013 17:58:31 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3B602B99F; Tue, 28 May 2013 13:58:28 -0400 (EDT) From: John Baldwin To: "Dag-Erling SmXXrgrav" Subject: Re: svn commit: r251058 - head Date: Tue, 28 May 2013 11:00:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305280952.r4S9qShX012991@svn.freebsd.org> In-Reply-To: <201305280952.r4S9qShX012991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305281100.35435.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 28 May 2013 13:58:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 17:58:31 -0000 On Tuesday, May 28, 2013 5:52:28 am Dag-Erling SmXXrgrav wrote: > Author: des > Date: Tue May 28 09:52:28 2013 > New Revision: 251058 > URL: http://svnweb.freebsd.org/changeset/base/251058 > > Log: > During buildkernel, print a banner before building modules. > > Modified: > head/Makefile.inc1 Does this honor 'makeoptions NO_MODULES=yes' in the kernel config? That sets NO_MODULES=yes in the generated Makefile, not in the environment seen by the make instance running this makefile. My guess is that this would result in 'make buildkernel' calling 'make modules-all' but 'modules-all' wouldn't be defined as a valid target? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue May 28 18:51:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12EF99C0; Tue, 28 May 2013 18:51:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE6A7ECE; Tue, 28 May 2013 18:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SIpUhW097487; Tue, 28 May 2013 18:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SIpUGv097485; Tue, 28 May 2013 18:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305281851.r4SIpUGv097485@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 28 May 2013 18:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251065 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 18:51:31 -0000 Author: hselasky Date: Tue May 28 18:51:30 2013 New Revision: 251065 URL: http://svnweb.freebsd.org/changeset/base/251065 Log: Revert r251023 until a more proper solution is found for ATI based USB controllers. MFC after: 1 week Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue May 28 18:43:58 2013 (r251064) +++ head/sys/dev/usb/controller/ehci.c Tue May 28 18:51:30 2013 (r251065) @@ -2454,7 +2454,6 @@ ehci_device_isoc_fs_enter(struct usb_xfe uint16_t tlen; uint8_t sa; uint8_t sb; - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2619,16 +2618,6 @@ ehci_device_isoc_fs_enter(struct usb_xfe EHCI_SITD_IOC | EHCI_SITD_ACTIVE | EHCI_SITD_SET_LEN(*plen)); - } else if (first != 0) { - /* - * Workaround for lost or too early - * completion interrupt: - */ - first = 0; - td->sitd_status = htohc32(sc, - EHCI_SITD_IOC | - EHCI_SITD_ACTIVE | - EHCI_SITD_SET_LEN(*plen)); } else { td->sitd_status = htohc32(sc, EHCI_SITD_ACTIVE | @@ -2770,7 +2759,6 @@ ehci_device_isoc_hs_enter(struct usb_xfe uint8_t td_no; uint8_t page_no; uint8_t shift = usbd_xfer_get_fps_shift(xfer); - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2932,13 +2920,6 @@ ehci_device_isoc_hs_enter(struct usb_xfe /* set IOC bit if we are complete */ if (nframes == 0) { td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); - } else if (first != 0) { - /* - * Workaround for lost or too early - * completion interrupt: - */ - first = 0; - td->itd_status[0] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #ifdef USB_DEBUG Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Tue May 28 18:43:58 2013 (r251064) +++ head/sys/dev/usb/controller/uhci.c Tue May 28 18:51:30 2013 (r251065) @@ -2138,7 +2138,6 @@ uhci_device_isoc_enter(struct usb_xfer * uint32_t nframes; uint32_t temp; uint32_t *plen; - uint8_t first = 1; #ifdef USB_DEBUG uint8_t once = 1; @@ -2254,18 +2253,6 @@ uhci_device_isoc_enter(struct usb_xfer * UHCI_TD_ACTIVE | UHCI_TD_IOS | UHCI_TD_IOC)); - } else if (first != 0) { - /* - * Workaround for lost or too early completion - * interrupt: - */ - first = 0; - td->td_status = htole32 - (UHCI_TD_ZERO_ACTLEN - (UHCI_TD_SET_ERRCNT(0) | - UHCI_TD_ACTIVE | - UHCI_TD_IOS | - UHCI_TD_IOC)); } else { td->td_status = htole32 (UHCI_TD_ZERO_ACTLEN From owner-svn-src-head@FreeBSD.ORG Tue May 28 20:04:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EA9B5C27 for ; Tue, 28 May 2013 20:04:57 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [IPv6:2607:f8b0:400c:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id AA33A29A for ; Tue, 28 May 2013 20:04:57 +0000 (UTC) Received: by mail-ve0-f181.google.com with SMTP id db10so4401695veb.40 for ; Tue, 28 May 2013 13:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=gQtM8Dmeht3Bx6dij3qwGBX605ZeJ6vSbxHVAiRWjZw=; b=OPYM8kRPmaMLjJyL731OnWAVbH9q+jBmTAGaFM5W5GwiAjFNl9aPk1Um5tYOnN4v4h naibxAx8JlmfPqF1EkLqFs7Bgo7Yqlk4xI0un9iJc7lgS6MsvleQVmat1vI9SYJgDmNB qxttcLXUL2C4AzcMNdwfVu1KpH/j09BoS9cVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=gQtM8Dmeht3Bx6dij3qwGBX605ZeJ6vSbxHVAiRWjZw=; b=FS9Wk7hy1I5+2YxF/X8+N4xHzTkhNtobYIYENVJLFsTmykS1kpgAN6871ofNYcQ3DJ DuxniwMiy72oi15T7HYOOwXgt0VFhbnSlQSX8c4LyZlt016WuQM/Ut4oP31q11tYUVTi QvzFGrRDfcM7FURnhAtYTaDLYan4ZdhKcrljGNxflZUe7Gzg+35CbHiDCpHQWNlnLH7d buNLOsx+uXfaYoYTH9ZO9M2fRCM4kzNs/yDM9AVDnymFOpKieOHtIs0L0xzfrVw7l6zr 8lGSxgJsv4LpRZagf9FV9cA++T6tA8rwi8wOsWVk7L+s/gXol+lX4C2LqtXbJGSu3M/d ojMQ== MIME-Version: 1.0 X-Received: by 10.220.76.137 with SMTP id c9mr3069827vck.48.1369771497172; Tue, 28 May 2013 13:04:57 -0700 (PDT) Received: by 10.220.119.2 with HTTP; Tue, 28 May 2013 13:04:56 -0700 (PDT) In-Reply-To: <201305280952.r4S9qShX012991@svn.freebsd.org> References: <201305280952.r4S9qShX012991@svn.freebsd.org> Date: Tue, 28 May 2013 13:04:56 -0700 Message-ID: Subject: Re: svn commit: r251058 - head From: Peter Wemm To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQn96brZ5d8X847i5dGUtw9ypYvY2O4FWVoCvd9Z9eMON0Aaja+VVewCXHo1oEuOtWYnFfon Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 20:04:58 -0000 On Tue, May 28, 2013 at 2:52 AM, Dag-Erling Sm=F8rgrav wr= ote: > Author: des > Date: Tue May 28 09:52:28 2013 > New Revision: 251058 > URL: http://svnweb.freebsd.org/changeset/base/251058 > > Log: > During buildkernel, print a banner before building modules. > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) > +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) > @@ -983,9 +983,16 @@ buildkernel: > .endif > @echo > @echo "----------------------------------------------------------= ----" > - @echo ">>> stage 3.2: building everything" > + @echo ">>> stage 3.2: building the kernel" > @echo "----------------------------------------------------------= ----" > - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ > + @echo > +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KER= NSRCDIR}/modules) > + @echo "----------------------------------------------------------= ----" > + @echo ">>> stage 3.3: building the modules" > + @echo "----------------------------------------------------------= ----" > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OB= J > +.endif > @echo "----------------------------------------------------------= ----" > @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=3DC d= ate`" > @echo "----------------------------------------------------------= ----" Please back this out or fix it ASAP. You broke every single machine in the freebsd.org cluster. make: don't know how to make modules-all. Stop *** [buildkernel] Error code 2 You are causing it to stop respecting makeoptions in the kernel config files. eg: eg: makeoptions NO_MODULES=3Dno or makeoptions MODULES_OVERRIDE=3D"zfs opensolaris" If you really want this echo here then you're going to need to reach down into the internals and make 'modules-all' work even when NO_MODULES is set. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-head@FreeBSD.ORG Tue May 28 20:11:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18E7BE02; Tue, 28 May 2013 20:11:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4F1D2CE; Tue, 28 May 2013 20:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKBS0i026144; Tue, 28 May 2013 20:11:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKBSia026143; Tue, 28 May 2013 20:11:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305282011.r4SKBSia026143@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 May 2013 20:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251066 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 20:11:29 -0000 Author: dim Date: Tue May 28 20:11:28 2013 New Revision: 251066 URL: http://svnweb.freebsd.org/changeset/base/251066 Log: Fix warnings from newer clang versions about constexpr member functions not being implicitly const in libc++'s header. The warnings have been introduced because of new language rules recently adopted by the C++ WG. More info: MFC after: 3 days Modified: head/contrib/libc++/include/chrono Modified: head/contrib/libc++/include/chrono ============================================================================== --- head/contrib/libc++/include/chrono Tue May 28 18:51:30 2013 (r251065) +++ head/contrib/libc++/include/chrono Tue May 28 20:11:28 2013 (r251066) @@ -468,7 +468,7 @@ template ::type _Ct; return _Ct(__lhs).count() == _Ct(__rhs).count(); @@ -479,7 +479,7 @@ template struct __duration_eq<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() == __rhs.count();} }; @@ -509,7 +509,7 @@ template ::type _Ct; return _Ct(__lhs).count() < _Ct(__rhs).count(); @@ -520,7 +520,7 @@ template struct __duration_lt<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() < __rhs.count();} }; From owner-svn-src-head@FreeBSD.ORG Tue May 28 20:37:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8F6E3821; Tue, 28 May 2013 20:37:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70BF062D; Tue, 28 May 2013 20:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKbotY034153; Tue, 28 May 2013 20:37:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKbmHB034143; Tue, 28 May 2013 20:37:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282037.r4SKbmHB034143@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 20:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251067 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 20:37:50 -0000 Author: emaste Date: Tue May 28 20:37:48 2013 New Revision: 251067 URL: http://svnweb.freebsd.org/changeset/base/251067 Log: Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Modified: head/lib/libc/net/sctp_bindx.3 head/lib/libc/net/sctp_connectx.3 head/lib/libc/net/sctp_freepaddrs.3 head/lib/libc/net/sctp_getaddrlen.3 head/lib/libc/net/sctp_getassocid.3 head/lib/libc/net/sctp_getpaddrs.3 head/lib/libc/net/sctp_opt_info.3 head/lib/libc/net/sctp_recvmsg.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 Modified: head/lib/libc/net/sctp_bindx.3 ============================================================================== --- head/lib/libc/net/sctp_bindx.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_bindx.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_connectx.3 ============================================================================== --- head/lib/libc/net/sctp_connectx.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_connectx.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_freepaddrs.3 ============================================================================== --- head/lib/libc/net/sctp_freepaddrs.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_freepaddrs.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_getaddrlen.3 ============================================================================== --- head/lib/libc/net/sctp_getaddrlen.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getaddrlen.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_getassocid.3 ============================================================================== --- head/lib/libc/net/sctp_getassocid.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getassocid.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_getpaddrs.3 ============================================================================== --- head/lib/libc/net/sctp_getpaddrs.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_getpaddrs.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_opt_info.3 ============================================================================== --- head/lib/libc/net/sctp_opt_info.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_opt_info.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- head/lib/libc/net/sctp_recvmsg.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_recvmsg.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_send.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Tue May 28 20:11:28 2013 (r251066) +++ head/lib/libc/net/sctp_sendmsg.3 Tue May 28 20:37:48 2013 (r251067) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" From owner-svn-src-head@FreeBSD.ORG Tue May 28 20:58:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A755222; Tue, 28 May 2013 20:58:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B056902; Tue, 28 May 2013 20:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKw0IL041053; Tue, 28 May 2013 20:58:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKvfcW040915; Tue, 28 May 2013 20:57:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282057.r4SKvfcW040915@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251069 - in head/lib/libc: stdlib string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 20:58:00 -0000 Author: emaste Date: Tue May 28 20:57:40 2013 New Revision: 251069 URL: http://svnweb.freebsd.org/changeset/base/251069 Log: Renumber clauses to reduce diffs to other versions NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier. Modified: head/lib/libc/stdlib/abort.3 head/lib/libc/stdlib/abort.c head/lib/libc/stdlib/abs.3 head/lib/libc/stdlib/abs.c head/lib/libc/stdlib/alloca.3 head/lib/libc/stdlib/atexit.3 head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/atexit.h head/lib/libc/stdlib/atof.3 head/lib/libc/stdlib/atof.c head/lib/libc/stdlib/atoi.3 head/lib/libc/stdlib/atoi.c head/lib/libc/stdlib/atol.3 head/lib/libc/stdlib/atol.c head/lib/libc/stdlib/atoll.c head/lib/libc/stdlib/bsearch.3 head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/div.3 head/lib/libc/stdlib/div.c head/lib/libc/stdlib/exit.3 head/lib/libc/stdlib/exit.c head/lib/libc/stdlib/getenv.3 head/lib/libc/stdlib/getopt.3 head/lib/libc/stdlib/getopt.c head/lib/libc/stdlib/getsubopt.3 head/lib/libc/stdlib/getsubopt.c head/lib/libc/stdlib/heapsort.c head/lib/libc/string/bcmp.3 head/lib/libc/string/bcmp.c head/lib/libc/string/bcopy.3 head/lib/libc/string/bcopy.c head/lib/libc/string/bstring.3 head/lib/libc/string/bzero.3 head/lib/libc/string/ffs.3 head/lib/libc/string/ffs.c head/lib/libc/string/ffsl.c head/lib/libc/string/ffsll.c head/lib/libc/string/fls.c head/lib/libc/string/flsl.c head/lib/libc/string/flsll.c head/lib/libc/string/index.3 head/lib/libc/string/memccpy.3 head/lib/libc/string/memccpy.c head/lib/libc/string/memchr.3 head/lib/libc/string/memchr.c head/lib/libc/string/memcmp.3 head/lib/libc/string/memcmp.c head/lib/libc/string/memcpy.3 head/lib/libc/string/memmove.3 head/lib/libc/string/memset.3 head/lib/libc/string/memset.c head/lib/libc/string/strcasecmp.3 head/lib/libc/string/strcasecmp.c head/lib/libc/string/strcasestr.c head/lib/libc/string/strcat.3 head/lib/libc/string/strcat.c head/lib/libc/string/strchr.3 head/lib/libc/string/strchr.c head/lib/libc/string/strcmp.3 head/lib/libc/string/strcmp.c head/lib/libc/string/strcoll.3 head/lib/libc/string/strcpy.3 head/lib/libc/string/strcpy.c head/lib/libc/string/strcspn.3 head/lib/libc/string/strdup.3 head/lib/libc/string/strdup.c head/lib/libc/string/strerror.3 head/lib/libc/string/strerror.c head/lib/libc/string/string.3 head/lib/libc/string/strlen.3 head/lib/libc/string/strmode.3 head/lib/libc/string/strmode.c head/lib/libc/string/strncat.c head/lib/libc/string/strncmp.c head/lib/libc/string/strncpy.c head/lib/libc/string/strndup.c head/lib/libc/string/strnstr.c head/lib/libc/string/strpbrk.3 head/lib/libc/string/strpbrk.c head/lib/libc/string/strrchr.c head/lib/libc/string/strsep.3 head/lib/libc/string/strsep.c head/lib/libc/string/strsignal.c head/lib/libc/string/strspn.3 head/lib/libc/string/strstr.3 head/lib/libc/string/strstr.c head/lib/libc/string/strtok.3 head/lib/libc/string/strtok.c head/lib/libc/string/strxfrm.3 head/lib/libc/string/swab.3 head/lib/libc/string/swab.c head/lib/libc/string/wcscmp.c head/lib/libc/string/wcscoll.3 head/lib/libc/string/wcsncmp.c head/lib/libc/string/wcsncpy.c head/lib/libc/string/wcsstr.c head/lib/libc/string/wcstok.c head/lib/libc/string/wcswidth.c head/lib/libc/string/wcsxfrm.3 head/lib/libc/string/wmemchr.3 Modified: head/lib/libc/stdlib/abort.3 ============================================================================== --- head/lib/libc/stdlib/abort.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abort.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/abort.c ============================================================================== --- head/lib/libc/stdlib/abort.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abort.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/abs.3 ============================================================================== --- head/lib/libc/stdlib/abs.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abs.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/abs.c ============================================================================== --- head/lib/libc/stdlib/abs.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/abs.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/alloca.3 ============================================================================== --- head/lib/libc/stdlib/alloca.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/alloca.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/atexit.3 ============================================================================== --- head/lib/libc/stdlib/atexit.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/atexit.h ============================================================================== --- head/lib/libc/stdlib/atexit.h Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atexit.h Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/atof.3 ============================================================================== --- head/lib/libc/stdlib/atof.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atof.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/atof.c ============================================================================== --- head/lib/libc/stdlib/atof.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atof.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/atoi.3 ============================================================================== --- head/lib/libc/stdlib/atoi.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoi.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/atoi.c ============================================================================== --- head/lib/libc/stdlib/atoi.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoi.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/atol.3 ============================================================================== --- head/lib/libc/stdlib/atol.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atol.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/atol.c ============================================================================== --- head/lib/libc/stdlib/atol.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atol.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/atoll.c ============================================================================== --- head/lib/libc/stdlib/atoll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/atoll.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/bsearch.3 ============================================================================== --- head/lib/libc/stdlib/bsearch.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/bsearch.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/bsearch.c ============================================================================== --- head/lib/libc/stdlib/bsearch.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/bsearch.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/div.3 ============================================================================== --- head/lib/libc/stdlib/div.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/div.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/div.c ============================================================================== --- head/lib/libc/stdlib/div.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/div.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/exit.3 ============================================================================== --- head/lib/libc/stdlib/exit.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/exit.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/exit.c ============================================================================== --- head/lib/libc/stdlib/exit.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/exit.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/getenv.3 ============================================================================== --- head/lib/libc/stdlib/getenv.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getenv.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/getopt.3 ============================================================================== --- head/lib/libc/stdlib/getopt.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getopt.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/getopt.c ============================================================================== --- head/lib/libc/stdlib/getopt.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getopt.c Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/getsubopt.3 ============================================================================== --- head/lib/libc/stdlib/getsubopt.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getsubopt.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/stdlib/getsubopt.c ============================================================================== --- head/lib/libc/stdlib/getsubopt.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/getsubopt.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/stdlib/heapsort.c ============================================================================== --- head/lib/libc/stdlib/heapsort.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/stdlib/heapsort.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/bcmp.3 ============================================================================== --- head/lib/libc/string/bcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/bcmp.c ============================================================================== --- head/lib/libc/string/bcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/bcopy.3 ============================================================================== --- head/lib/libc/string/bcopy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcopy.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/bcopy.c ============================================================================== --- head/lib/libc/string/bcopy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bcopy.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/bstring.3 ============================================================================== --- head/lib/libc/string/bstring.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bstring.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/bzero.3 ============================================================================== --- head/lib/libc/string/bzero.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/bzero.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/ffs.3 ============================================================================== --- head/lib/libc/string/ffs.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffs.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/ffs.c ============================================================================== --- head/lib/libc/string/ffs.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffs.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/ffsl.c ============================================================================== --- head/lib/libc/string/ffsl.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffsl.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/ffsll.c ============================================================================== --- head/lib/libc/string/ffsll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/ffsll.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/fls.c ============================================================================== --- head/lib/libc/string/fls.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/fls.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/flsl.c ============================================================================== --- head/lib/libc/string/flsl.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/flsl.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/flsll.c ============================================================================== --- head/lib/libc/string/flsll.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/flsll.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/index.3 ============================================================================== --- head/lib/libc/string/index.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/index.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memccpy.3 ============================================================================== --- head/lib/libc/string/memccpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memccpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memccpy.c ============================================================================== --- head/lib/libc/string/memccpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memccpy.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/memchr.3 ============================================================================== --- head/lib/libc/string/memchr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memchr.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memchr.c ============================================================================== --- head/lib/libc/string/memchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memchr.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/memcmp.3 ============================================================================== --- head/lib/libc/string/memcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memcmp.c ============================================================================== --- head/lib/libc/string/memcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/memcpy.3 ============================================================================== --- head/lib/libc/string/memcpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memcpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memmove.3 ============================================================================== --- head/lib/libc/string/memmove.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memmove.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memset.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/memset.c ============================================================================== --- head/lib/libc/string/memset.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/memset.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcasecmp.3 ============================================================================== --- head/lib/libc/string/strcasecmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasecmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strcasecmp.c ============================================================================== --- head/lib/libc/string/strcasecmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasecmp.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcasestr.c ============================================================================== --- head/lib/libc/string/strcasestr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcasestr.c Tue May 28 20:57:40 2013 (r251069) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcat.3 ============================================================================== --- head/lib/libc/string/strcat.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcat.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strcat.c ============================================================================== --- head/lib/libc/string/strcat.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcat.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strchr.3 ============================================================================== --- head/lib/libc/string/strchr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strchr.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strchr.c ============================================================================== --- head/lib/libc/string/strchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strchr.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcmp.3 ============================================================================== --- head/lib/libc/string/strcmp.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcmp.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strcmp.c ============================================================================== --- head/lib/libc/string/strcmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcmp.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcoll.3 ============================================================================== --- head/lib/libc/string/strcoll.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcoll.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcpy.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strcpy.c ============================================================================== --- head/lib/libc/string/strcpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcpy.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strcspn.3 ============================================================================== --- head/lib/libc/string/strcspn.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strcspn.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strdup.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strdup.c ============================================================================== --- head/lib/libc/string/strdup.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strdup.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strerror.3 ============================================================================== --- head/lib/libc/string/strerror.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strerror.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strerror.c ============================================================================== --- head/lib/libc/string/strerror.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strerror.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/string.3 ============================================================================== --- head/lib/libc/string/string.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/string.3 Tue May 28 20:57:40 2013 (r251069) @@ -11,7 +11,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strlen.3 ============================================================================== --- head/lib/libc/string/strlen.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strlen.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strmode.3 ============================================================================== --- head/lib/libc/string/strmode.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strmode.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strmode.c ============================================================================== --- head/lib/libc/string/strmode.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strmode.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strncat.c ============================================================================== --- head/lib/libc/string/strncat.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncat.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strncmp.c ============================================================================== --- head/lib/libc/string/strncmp.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncmp.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strncpy.c ============================================================================== --- head/lib/libc/string/strncpy.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strncpy.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strndup.c ============================================================================== --- head/lib/libc/string/strndup.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strndup.c Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strnstr.c ============================================================================== --- head/lib/libc/string/strnstr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strnstr.c Tue May 28 20:57:40 2013 (r251069) @@ -14,7 +14,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strpbrk.3 ============================================================================== --- head/lib/libc/string/strpbrk.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strpbrk.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strpbrk.c ============================================================================== --- head/lib/libc/string/strpbrk.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strpbrk.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strrchr.c ============================================================================== --- head/lib/libc/string/strrchr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strrchr.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strsep.3 ============================================================================== --- head/lib/libc/string/strsep.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsep.3 Tue May 28 20:57:40 2013 (r251069) @@ -12,7 +12,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strsep.c ============================================================================== --- head/lib/libc/string/strsep.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsep.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strsignal.c Tue May 28 20:57:40 2013 (r251069) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strspn.3 ============================================================================== --- head/lib/libc/string/strspn.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strspn.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strstr.3 ============================================================================== --- head/lib/libc/string/strstr.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strstr.3 Tue May 28 20:57:40 2013 (r251069) @@ -14,7 +14,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/strstr.c ============================================================================== --- head/lib/libc/string/strstr.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strstr.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strtok.3 ============================================================================== --- head/lib/libc/string/strtok.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strtok.3 Tue May 28 20:57:40 2013 (r251069) @@ -22,7 +22,7 @@ .\" disclaimer in the documentation and/or other materials provided .\" with the distribution. .\" -.\" 4. Neither the name of Softweyr LLC, the University nor the names +.\" 3. Neither the name of Softweyr LLC, 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. Modified: head/lib/libc/string/strtok.c ============================================================================== --- head/lib/libc/string/strtok.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strtok.c Tue May 28 20:57:40 2013 (r251069) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notices, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/string/strxfrm.3 ============================================================================== --- head/lib/libc/string/strxfrm.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/strxfrm.3 Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/swab.3 ============================================================================== --- head/lib/libc/string/swab.3 Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/swab.3 Tue May 28 20:57:40 2013 (r251069) @@ -9,7 +9,7 @@ .\" 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. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/string/swab.c ============================================================================== --- head/lib/libc/string/swab.c Tue May 28 20:53:26 2013 (r251068) +++ head/lib/libc/string/swab.c Tue May 28 20:57:40 2013 (r251069) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:05:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEA1E583; Tue, 28 May 2013 21:05:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF21F93E; Tue, 28 May 2013 21:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SL57Bo044344; Tue, 28 May 2013 21:05:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SL56I0044336; Tue, 28 May 2013 21:05:06 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305282105.r4SL56I0044336@svn.freebsd.org> From: Ed Maste Date: Tue, 28 May 2013 21:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251071 - in head/lib/libc: gen net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:05:08 -0000 Author: emaste Date: Tue May 28 21:05:06 2013 New Revision: 251071 URL: http://svnweb.freebsd.org/changeset/base/251071 Log: Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Modified: head/lib/libc/gen/fts-compat.h head/lib/libc/net/name6.c head/lib/libc/sys/sctp_generic_recvmsg.2 head/lib/libc/sys/sctp_generic_sendmsg.2 head/lib/libc/sys/sctp_peeloff.2 Modified: head/lib/libc/gen/fts-compat.h ============================================================================== --- head/lib/libc/gen/fts-compat.h Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/gen/fts-compat.h Tue May 28 21:05:06 2013 (r251071) @@ -10,11 +10,7 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/net/name6.c Tue May 28 21:05:06 2013 (r251071) @@ -42,11 +42,7 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/lib/libc/sys/sctp_generic_recvmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_recvmsg.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_generic_recvmsg.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/sys/sctp_generic_sendmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_sendmsg.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_generic_sendmsg.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" Modified: head/lib/libc/sys/sctp_peeloff.2 ============================================================================== --- head/lib/libc/sys/sctp_peeloff.2 Tue May 28 20:58:57 2013 (r251070) +++ head/lib/libc/sys/sctp_peeloff.2 Tue May 28 21:05:06 2013 (r251071) @@ -9,11 +9,7 @@ .\" 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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 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. .\" From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:21:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 227FDD48; Tue, 28 May 2013 21:21:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15326A5B; Tue, 28 May 2013 21:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLLkib050771; Tue, 28 May 2013 21:21:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLLkT4050770; Tue, 28 May 2013 21:21:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305282121.r4SLLkT4050770@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 28 May 2013 21:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251072 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:21:47 -0000 Author: pjd Date: Tue May 28 21:21:46 2013 New Revision: 251072 URL: http://svnweb.freebsd.org/changeset/base/251072 Log: MFp4 @229085: Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given, as the result won't be used then. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 28 21:05:06 2013 (r251071) +++ head/usr.bin/kdump/kdump.c Tue May 28 21:21:46 2013 (r251072) @@ -1205,6 +1205,11 @@ ktrgenio(struct ktr_genio *ktr, int len) static int screenwidth = 0; int i, binary; + printf("fd %d %s %d byte%s\n", ktr->ktr_fd, + ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen, + datalen == 1 ? "" : "s"); + if (suppressdata) + return; if (screenwidth == 0) { struct winsize ws; @@ -1214,11 +1219,6 @@ ktrgenio(struct ktr_genio *ktr, int len) else screenwidth = 80; } - printf("fd %d %s %d byte%s\n", ktr->ktr_fd, - ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen, - datalen == 1 ? "" : "s"); - if (suppressdata) - return; if (maxdata && datalen > maxdata) datalen = maxdata; From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:22:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C2C4EC7; Tue, 28 May 2013 21:22:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id C8491A68; Tue, 28 May 2013 21:22:14 +0000 (UTC) Received: from glenbarber.us (static-108-16-252-210.phlapa.fios.verizon.net [108.16.252.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4B90723F804; Tue, 28 May 2013 17:22:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 4B90723F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 28 May 2013 17:22:11 -0400 From: Glen Barber To: Peter Wemm Subject: Re: svn commit: r251058 - head Message-ID: <20130528212211.GA1652@glenbarber.us> References: <201305280952.r4S9qShX012991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: 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, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:22:15 -0000 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2013 at 01:04:56PM -0700, Peter Wemm wrote: > On Tue, May 28, 2013 at 2:52 AM, Dag-Erling Sm=F8rgrav = wrote: > > Author: des > > Date: Tue May 28 09:52:28 2013 > > New Revision: 251058 > > URL: http://svnweb.freebsd.org/changeset/base/251058 > > > > Log: > > During buildkernel, print a banner before building modules. > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Tue May 28 09:51:27 2013 (r251057) > > +++ head/Makefile.inc1 Tue May 28 09:52:28 2013 (r251058) > > @@ -983,9 +983,16 @@ buildkernel: > > .endif > > @echo > > @echo "--------------------------------------------------------= ------" > > - @echo ">>> stage 3.2: building everything" > > + @echo ">>> stage 3.2: building the kernel" > > @echo "--------------------------------------------------------= ------" > > - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ > > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_O= BJ > > + @echo > > +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${K= ERNSRCDIR}/modules) > > + @echo "--------------------------------------------------------= ------" > > + @echo ">>> stage 3.3: building the modules" > > + @echo "--------------------------------------------------------= ------" > > + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_= OBJ > > +.endif > > @echo "--------------------------------------------------------= ------" > > @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=3DC= date`" > > @echo "--------------------------------------------------------= ------" >=20 > Please back this out or fix it ASAP. You broke every single machine in > the freebsd.org cluster. >=20 > make: don't know how to make modules-all. Stop > *** [buildkernel] Error code 2 >=20 > You are causing it to stop respecting makeoptions in the kernel config > files. eg: >=20 > eg: >=20 > makeoptions NO_MODULES=3Dno > or > makeoptions MODULES_OVERRIDE=3D"zfs opensolaris" >=20 > If you really want this echo here then you're going to need to reach > down into the internals and make 'modules-all' work even when > NO_MODULES is set. This also breaks i386 PAE build in tinderbox... make: don't know how to make modules-all. Stop make: stopped in /obj/i386.i386/src/sys/PAE *** Error code 2 Stop. make: stopped in /src *** Error code 1 Stop in /src. TB --- 2013-05-28 21:10:00 - WARNING: /usr/bin/make returned exit code 1 TB --- 2013-05-28 21:10:00 - ERROR: failed to build PAE kernel TB --- 2013-05-28 21:10:00 - 18049.16 user 3184.18 system 22779.88 real http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full Glen --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRpSADAAoJEFJPDDeguUajSToH/ArJ9GNXt0uPZ/GaNb3yUejf uJtCevrtHnBhDudrSuhKlTCXzH4fs5Nveg6/TsAym9au5VIaE0CUtXs/uxSw6FN0 aH5KYcK5uJ/x2cD8nvJfrQOdXuocu1VA6J96zoPgnqmYDbqQVs+ykYHb8NTNzeh6 bYRUA6oOsJYg2KI90XJ7j2z1vLXaa7GbdATmFBsMP7NmosW69EtMfJqpT4QH6DJm zlQnw11Fp5+8PbYLg4bpYt2t6G2kYvoV024ZLjNAPokgfItmln8GxRTPwuCQ7QLc 1htKPSX9KqRKmqkUZWCFB1CUI70BQdUZGrfViGoVOCYuXzdA79kEd/H7O04N6BY= =hHgM -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe-- From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:25:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 83CC7147; Tue, 28 May 2013 21:25:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76621AA2; Tue, 28 May 2013 21:25:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLPTn2051503; Tue, 28 May 2013 21:25:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLPTSw051502; Tue, 28 May 2013 21:25:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305282125.r4SLPTSw051502@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 28 May 2013 21:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251073 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:25:29 -0000 Author: pjd Date: Tue May 28 21:25:28 2013 New Revision: 251073 URL: http://svnweb.freebsd.org/changeset/base/251073 Log: MFp4 @229086: Make use of Capsicum to protect kdump(1), as it might be used to parse data from untrusted sources: - Sandbox kdump(1) using capability mode. - Limit stdin descriptor (where opened file is moved to) to only CAP_READ and CAP_FSTAT rights. - Limit stdout descriptor to only CAP_WRITE, CAP_FSTAT and CAP_IOCTL. Plus limit allowed ioctls to TIOCGETA only, which is needed for isatty() to work. - Limit stderr descriptor to only CAP_WRITE and CAP_FSTAT. In addition if the -s option is not given, grant CAP_IOCTL right, but allow for TIOCGWINSZ ioctl only, as we need screen width to dump the data. - Before entering capability mode call catopen("libc", NL_CAT_LOCALE), which opens message catalogs and caches data, so that strerror(3) and strsignal(3) can work in a sandbox. Sponsored by: The FreeBSD Foundation Discussed with: rwatson Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 28 21:21:46 2013 (r251072) +++ head/usr.bin/kdump/kdump.c Tue May 28 21:25:28 2013 (r251073) @@ -46,6 +46,7 @@ extern int errno; #include #undef _KERNEL #include +#include #include #define _KERNEL #include @@ -73,10 +74,12 @@ extern int errno; #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -105,6 +108,7 @@ void ktrstruct(char *, size_t); void ktrcapfail(struct ktr_cap_fail *); void ktrfault(struct ktr_fault *); void ktrfaultend(struct ktr_faultend *); +void limitfd(int fd); void usage(void); void ioctlname(unsigned long, int); @@ -230,6 +234,18 @@ main(int argc, char *argv[]) errx(1, "%s", strerror(ENOMEM)); if (!freopen(tracefile, "r", stdin)) err(1, "%s", tracefile); + + /* + * Cache NLS data before entering capability mode. + * XXXPJD: There should be strerror_init() and strsignal_init() in libc. + */ + (void)catopen("libc", NL_CAT_LOCALE); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + limitfd(STDIN_FILENO); + limitfd(STDOUT_FILENO); + limitfd(STDERR_FILENO); + TAILQ_INIT(&trace_procs); drop_logged = 0; while (fread_tail(&ktr_header, sizeof(struct ktr_header), 1)) { @@ -331,6 +347,40 @@ main(int argc, char *argv[]) return 0; } +void +limitfd(int fd) +{ + cap_rights_t rights; + unsigned long cmd; + + rights = CAP_FSTAT; + cmd = -1; + + switch (fd) { + case STDIN_FILENO: + rights |= CAP_READ; + break; + case STDOUT_FILENO: + rights |= CAP_IOCTL | CAP_WRITE; + cmd = TIOCGETA; /* required by isatty(3) in printf(3) */ + break; + case STDERR_FILENO: + rights |= CAP_WRITE; + if (!suppressdata) { + rights |= CAP_IOCTL; + cmd = TIOCGWINSZ; + } + break; + default: + abort(); + } + + if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for descriptor %d", fd); + if (cmd != -1 && cap_ioctls_limit(fd, &cmd, 1) < 0 && errno != ENOSYS) + err(1, "unable to limit ioctls for descriptor %d", fd); +} + int fread_tail(void *buf, int size, int num) { From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:29:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73B6832E; Tue, 28 May 2013 21:29:06 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65852AD0; Tue, 28 May 2013 21:29:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLT6EG052166; Tue, 28 May 2013 21:29:06 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLT67h052165; Tue, 28 May 2013 21:29:06 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201305282129.r4SLT67h052165@svn.freebsd.org> From: Peter Wemm Date: Tue, 28 May 2013 21:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251074 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:29:06 -0000 Author: peter Date: Tue May 28 21:29:05 2013 New Revision: 251074 URL: http://svnweb.freebsd.org/changeset/base/251074 Log: Temporarily revert r251058 - it breaks documented use of makeoptions including the tinderbox. http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full make: don't know how to make modules-all. Stop make: stopped in /obj/i386.i386/src/sys/PAE *** Error code 2 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 21:25:28 2013 (r251073) +++ head/Makefile.inc1 Tue May 28 21:29:05 2013 (r251074) @@ -983,16 +983,9 @@ buildkernel: .endif @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 3.2: building the kernel" + @echo ">>> stage 3.2: building everything" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ - @echo -.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) - @echo "--------------------------------------------------------------" - @echo ">>> stage 3.3: building the modules" - @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ -.endif + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Tue May 28 21:57:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 59EB2B9F; Tue, 28 May 2013 21:57:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB43D26; Tue, 28 May 2013 21:57:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SLvtx0061984; Tue, 28 May 2013 21:57:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SLvtct061983; Tue, 28 May 2013 21:57:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282157.r4SLvtct061983@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 21:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251075 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 21:57:56 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 21:57:55 2013 New Revision: 251075 URL: http://svnweb.freebsd.org/changeset/base/251075 Log: Update comments to reflect use of svn/svnup to keep the src/ tree up to date. MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 21:29:05 2013 (r251074) +++ head/Makefile.inc1 Tue May 28 21:57:55 2013 (r251075) @@ -35,7 +35,7 @@ # buildworld - rebuild *everything*, including glue to help do upgrades # installworld- install everything built by "buildworld" # doxygen - build API documentation of the kernel -# update - convenient way to update your source tree (eg: cvsup/cvs) +# update - convenient way to update your source tree (eg: svn/svnup) # # Standard targets (not defined here) are documented in the makefiles in # /usr/share/mk. These include: @@ -1076,7 +1076,7 @@ doxygen: # # update # -# Update the source tree(s), by running cvsup/cvs/svn to update to the +# Update the source tree(s), by running svn/svnup to update to the # latest copy. # update: From owner-svn-src-head@FreeBSD.ORG Tue May 28 22:00:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FC59D50; Tue, 28 May 2013 22:00:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3250AD50; Tue, 28 May 2013 22:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM0cf8062835; Tue, 28 May 2013 22:00:38 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM0cZX062834; Tue, 28 May 2013 22:00:38 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201305282200.r4SM0cZX062834@svn.freebsd.org> From: David C Somayajulu Date: Tue, 28 May 2013 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251076 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 22:00:38 -0000 Author: davidcs Date: Tue May 28 22:00:37 2013 New Revision: 251076 URL: http://svnweb.freebsd.org/changeset/base/251076 Log: Avoid reading back certain registers following a write. This is an optimization. Submitted by: David C Somayajulu Approved by: George Neville Neil Modified: head/sys/dev/qlxgbe/ql_hw.h Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Tue May 28 21:57:55 2013 (r251075) +++ head/sys/dev/qlxgbe/ql_hw.h Tue May 28 22:00:37 2013 (r251076) @@ -1533,16 +1533,16 @@ typedef struct _qla_hw { } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ - WRITE_REG32(ha, prod_reg, val); + bus_write_4((ha->pci_reg), prod_reg, val); #define QL_UPDATE_TX_PRODUCER_INDEX(ha, val, i) \ - WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) + WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) #define QL_UPDATE_SDS_CONSUMER_INDEX(ha, i, val) \ - WRITE_REG32(ha, ha->hw.sds[i].sds_consumer, val) - -#define QL_ENABLE_INTERRUPTS(ha, i) WRITE_REG32(ha, ha->hw.intr_src[i], 0); + bus_write_4((ha->pci_reg), (ha->hw.sds[i].sds_consumer), val); +#define QL_ENABLE_INTERRUPTS(ha, i) \ + bus_write_4((ha->pci_reg), (ha->hw.intr_src[i]), 0); #define QL_BUFFER_ALIGN 16 From owner-svn-src-head@FreeBSD.ORG Tue May 28 22:07:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CACC4F40; Tue, 28 May 2013 22:07:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3AB4D88; Tue, 28 May 2013 22:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM7Nek065772; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM7Nh2065771; Tue, 28 May 2013 22:07:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305282207.r4SM7Nh2065771@svn.freebsd.org> From: Attilio Rao Date: Tue, 28 May 2013 22:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251077 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 22:07:23 -0000 Author: attilio Date: Tue May 28 22:07:23 2013 New Revision: 251077 URL: http://svnweb.freebsd.org/changeset/base/251077 Log: o Change the locking scheme for swp_bcount. It can now be accessed with a write lock on the object containing it OR with a read lock on the object containing it along with the swhash_mtx. o Remove some duplicate assertions for swap_pager_freespace() and swap_pager_unswapped() but keep the object locking references for documentation. Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue May 28 22:00:37 2013 (r251076) +++ head/sys/vm/swap_pager.c Tue May 28 22:07:23 2013 (r251077) @@ -822,12 +822,13 @@ swp_pager_freeswapspace(daddr_t blk, int * The external callers of this routine typically have already destroyed * or renamed vm_page_t's associated with this range in the object so * we should be ok. + * + * The object must be locked. */ void swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) { - VM_OBJECT_ASSERT_WLOCKED(object); swp_pager_meta_free(object, start, size); } @@ -999,7 +1000,7 @@ swap_pager_haspage(vm_object_t object, v { daddr_t blk0; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * do we have good backing store at the requested index ? */ @@ -1065,12 +1066,13 @@ swap_pager_haspage(vm_object_t object, v * depends on it. * * This routine may not sleep. + * + * The object containing the page must be locked. */ static void swap_pager_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(m->object); swp_pager_meta_ctl(m->object, m->pindex, SWM_FREE); } @@ -1916,7 +1918,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count) { - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); if (object->type != OBJT_SWAP) return; @@ -2021,7 +2023,7 @@ swp_pager_meta_ctl(vm_object_t object, v daddr_t r1; int idx; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); /* * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet. From owner-svn-src-head@FreeBSD.ORG Tue May 28 22:07:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 444E6ED; Tue, 28 May 2013 22:07:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 373ECD8A; Tue, 28 May 2013 22:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SM7Ww6065841; Tue, 28 May 2013 22:07:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SM7We8065840; Tue, 28 May 2013 22:07:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305282207.r4SM7We8065840@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 28 May 2013 22:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251078 - head/bin/sleep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 22:07:32 -0000 Author: jilles Date: Tue May 28 22:07:31 2013 New Revision: 251078 URL: http://svnweb.freebsd.org/changeset/base/251078 Log: sleep: Improve nanosleep() error handling: * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Modified: head/bin/sleep/sleep.c Modified: head/bin/sleep/sleep.c ============================================================================== --- head/bin/sleep/sleep.c Tue May 28 22:07:23 2013 (r251077) +++ head/bin/sleep/sleep.c Tue May 28 22:07:31 2013 (r251078) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -87,8 +88,8 @@ main(int argc, char *argv[]) warnx("about %d second(s) left out of the original %d", (int)time_to_sleep.tv_sec, (int)original); report_requested = 0; - } else - break; + } else if (errno != EINTR) + err(1, "nanosleep"); } return (0); } From owner-svn-src-head@FreeBSD.ORG Tue May 28 22:36:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6733A713; Tue, 28 May 2013 22:36:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58E0FEDB; Tue, 28 May 2013 22:36:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SMa2qh075795; Tue, 28 May 2013 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SMa2Cp075794; Tue, 28 May 2013 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305282236.r4SMa2Cp075794@svn.freebsd.org> From: Rick Macklem Date: Tue, 28 May 2013 22:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251079 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 22:36:02 -0000 Author: rmacklem Date: Tue May 28 22:36:01 2013 New Revision: 251079 URL: http://svnweb.freebsd.org/changeset/base/251079 Log: Post-r248567, there were times when the client would return a truncated directory for some NFS servers. This turned out to be because the size of a directory reported by an NFS server can be smaller that the ufs-like directory created from the RPC XDR in the client. This patch fixes the problem by changing r248567 so that vnode_pager_setsize() is only done for regular files. Reported and tested by: hartmut.brandt@dlr.de Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue May 28 22:07:31 2013 (r251078) +++ head/sys/fs/nfsclient/nfs_clport.c Tue May 28 22:36:01 2013 (r251079) @@ -448,12 +448,10 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - } else { - np->n_size = vap->va_size; - } - if (vap->va_type == VREG || vap->va_type == VDIR) { setnsize = 1; nsize = vap->va_size; + } else { + np->n_size = vap->va_size; } } /* From owner-svn-src-head@FreeBSD.ORG Tue May 28 23:32:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8463068B for ; Tue, 28 May 2013 23:32:36 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5EFB529B for ; Tue, 28 May 2013 23:32:36 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb11so7090024pad.23 for ; Tue, 28 May 2013 16:32:35 -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=k6GW0Hux/flVnW31a+L1QQyZ/T8kZB+uuzcvm7CWofk=; b=kMFCghv+K9n2BAizJdRZ85tN6gB84DCnyBD3SIZ5NxhXA6MlDB+TPaV0Tw5GNkLtOG KYhfSEO1icJbknd6aZLTWmJrcJkyZ7llywHJGVSBQBD2M+PjwRd4RgCJ2yYeYF6vPeRN p3xCK+K+OaU47YS8cqC+xpOht52t1YhxFm5m8= 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=k6GW0Hux/flVnW31a+L1QQyZ/T8kZB+uuzcvm7CWofk=; b=M22eqBRQv4wrpm6wblR5TdWmAQV5JwebgFIENFqzXRssafmuytQd4wr78hU1mWOgdl LceCuC/32bDlpd0kou2RYR4BJVe0jJf+ILlDX3KKuZDctUdWGkjQEEVa7U6oask+yWub 9uAPccrXND8izA25tQ1VhoQi4t7T3ak+rJF0zxsh52y7nwrzmPC2E86tje7UmJ7+di9l mSg1HN8LIRuC7XpCtwSeqOnir6EMgxYvc5mzR/dS0vna5cv8wNhATb85DuTlw0J4aXk+ AZRl84X7FwdRYcNXPh0YHQ1l8zz+TFiBbiPIeuhL4hdQ+53AFDDt/Q4yyOe7a0Ez3Jo/ XgCQ== X-Received: by 10.66.27.243 with SMTP id w19mr568266pag.180.1369783955776; Tue, 28 May 2013 16:32:35 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.84.100 with HTTP; Tue, 28 May 2013 16:32:05 -0700 (PDT) In-Reply-To: <201305282207.r4SM7We8065840@svn.freebsd.org> References: <201305282207.r4SM7We8065840@svn.freebsd.org> From: Eitan Adler Date: Wed, 29 May 2013 01:32:05 +0200 X-Google-Sender-Auth: OLR93XMwrA1_VpyS8IOX9mukG4g Message-ID: Subject: Re: svn commit: r251078 - head/bin/sleep To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnb0w9jYXib7ol/luN3oycvjxa3mf5Tq1p2WsaJR3lkFss6apy+bL8daSyOEweSGdQqw74P Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 23:32:36 -0000 On 29 May 2013 00:07, Jilles Tjoelker wrote: > Author: jilles > Date: Tue May 28 22:07:31 2013 > New Revision: 251078 > URL: http://svnweb.freebsd.org/changeset/base/251078 > > Log: > sleep: Improve nanosleep() error handling: > > * Work around kernel bugs that cause a spurious [EINTR] return if a > debugger (such as truss(1)) is attached. The the fact that this is a workaround be noted in a comment so the code may be removed when the bug is fixed? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue May 28 23:43:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02D16EF7; Tue, 28 May 2013 23:43:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA750354; Tue, 28 May 2013 23:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNhlmu099670; Tue, 28 May 2013 23:43:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNhlm7099668; Tue, 28 May 2013 23:43:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282343.r4SNhlm7099668@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251084 - in head: . release/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 23:43:48 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:43:47 2013 New Revision: 251084 URL: http://svnweb.freebsd.org/changeset/base/251084 Log: r245757 introduced warning output if update method is set to CVS_UPDATE or SUP_UPDATE. CVS exporter for head/ is turned off for nearly one month now. It is finally time to swing the ax at these update methods. Reviewed by: eadler MFC after: 1 month Modified: head/Makefile.inc1 head/release/doc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 28 23:43:11 2013 (r251083) +++ head/Makefile.inc1 Tue May 28 23:43:47 2013 (r251084) @@ -114,15 +114,8 @@ LOCAL_TOOL_DIRS?= BUILDENV_SHELL?=/bin/sh -CVS?= cvs -CVSFLAGS?= -A -P -d -I! -SVN?= svn +SVN?= /usr/local/bin/svn SVNFLAGS?= -r HEAD -SUP?= /usr/bin/csup -SUPFLAGS?= -g -L 2 -.if defined(SUPHOST) -SUPFLAGS+= -h ${SUPHOST} -.endif MAKEOBJDIRPREFIX?= /usr/obj .if !defined(OSRELDATE) @@ -1080,59 +1073,18 @@ doxygen: # latest copy. # update: -.if defined(SUP_UPDATE) +.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) @echo "--------------------------------------------------------------" - @echo ">>> Running ${SUP}" + @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." + @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" @echo "--------------------------------------------------------------" - @echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" - @echo "!! Update methods with ${SUP} are deprecated." - @echo "!! Please see http://www.freebsd.org/handbook/svn.html" - @echo "!! and convert your update method to SVN_UPDATE or" - @echo "!! freebsd-update(8)." - @echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" - @sleep 5 -.if defined(SUPFILE) - @${SUP} ${SUPFLAGS} ${SUPFILE} -.endif -.if defined(SUPFILE1) - @${SUP} ${SUPFLAGS} ${SUPFILE1} -.endif -.if defined(SUPFILE2) - @${SUP} ${SUPFLAGS} ${SUPFILE2} -.endif -.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) - @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} -.endif -.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) - @${SUP} ${SUPFLAGS} ${DOCSUPFILE} -.endif -.endif -.if defined(CVS_UPDATE) - @cd ${.CURDIR} ; \ - if [ -d CVS ] ; then \ - echo "--------------------------------------------------------------" ; \ - echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ - echo "--------------------------------------------------------------" ; \ - echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" ; \ - echo "!! Update methods with CVS are deprecated." ; \ - echo "!! Please see http://www.freebsd.org/handbook/svn.html" ; \ - echo "!! and convert your update method to SVN_UPDATE or" ; \ - echo "!! freebsd-update(8)." ; \ - echo "!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!" ; \ - sleep 5 ; \ - echo ${CVS} -R -q update ${CVSFLAGS} ; \ - ${CVS} -R -q update ${CVSFLAGS} ; \ - fi + @exit 1 .endif .if defined(SVN_UPDATE) - @cd ${.CURDIR} ; \ - if [ -d .svn ] ; then \ - echo "--------------------------------------------------------------" ; \ - echo ">>> Updating ${.CURDIR} using Subversion" ; \ - echo "--------------------------------------------------------------" ; \ - echo ${SVN} update ${SVNFLAGS} ; \ - ${SVN} update ${SVNFLAGS} ; \ - fi + @echo "--------------------------------------------------------------" + @echo ">>> Updating ${.CURDIR} using Subversion" + @echo "--------------------------------------------------------------" + @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .endif # Modified: head/release/doc/Makefile ============================================================================== --- head/release/doc/Makefile Tue May 28 23:43:11 2013 (r251083) +++ head/release/doc/Makefile Tue May 28 23:43:47 2013 (r251084) @@ -12,26 +12,30 @@ SUBDIR+= share/xml RELN_ROOT?= ${.CURDIR} -.if defined(SUPHOST) -SUPFLAGS+= -h ${SUPHOST} -.endif +SVN?= /usr/local/bin/svn +SVNFLAGS?= -r HEAD + update: -.if defined(SUP_UPDATE) -.if !defined(DOCSUPFILE) - @echo "Error: Please define DOCSUPFILE before doing make update." +.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) + @echo "--------------------------------------------------------------" + @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." + @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" + @echo "--------------------------------------------------------------" @exit 1 .endif +.if defined(SVN_UPDATE) +. if !exists(${SVN}) @echo "--------------------------------------------------------------" - @echo ">>> Running ${SUP}" + @echo ">>> Updating ${RELN_ROOT} requires ${SVN}." @echo "--------------------------------------------------------------" - @${SUP} ${SUPFLAGS} ${DOCSUPFILE} -.elif defined(CVS_UPDATE) + @exit 1 +. endif @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} + @echo ">>> Updating ${.CURDIR} using Subversion" @echo "--------------------------------------------------------------" - cd ${.CURDIR}; cvs -q update -P -d + @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .else - @echo "Error: Please define either SUP_UPDATE or CVS_UPDATE first." + @echo "Error: Please define SUP_UPDATE first." .endif .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" From owner-svn-src-head@FreeBSD.ORG Tue May 28 23:46:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D954A153; Tue, 28 May 2013 23:46:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB2B237A; Tue, 28 May 2013 23:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNkDkv000332; Tue, 28 May 2013 23:46:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNkDqN000331; Tue, 28 May 2013 23:46:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282346.r4SNkDqN000331@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251085 - head/release/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 23:46:13 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:46:13 2013 New Revision: 251085 URL: http://svnweb.freebsd.org/changeset/base/251085 Log: Fix typo introduced in r251084. MFC after: 1 month X-MFC-With: r251084 Modified: head/release/doc/Makefile Modified: head/release/doc/Makefile ============================================================================== --- head/release/doc/Makefile Tue May 28 23:43:47 2013 (r251084) +++ head/release/doc/Makefile Tue May 28 23:46:13 2013 (r251085) @@ -35,7 +35,7 @@ update: @echo "--------------------------------------------------------------" @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) .else - @echo "Error: Please define SUP_UPDATE first." + @echo "Error: Please define SVN_UPDATE first." .endif .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" From owner-svn-src-head@FreeBSD.ORG Tue May 28 23:52:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C1925F4; Tue, 28 May 2013 23:52:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5605D5E6; Tue, 28 May 2013 23:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNq2Ov002934; Tue, 28 May 2013 23:52:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNq2jK002933; Tue, 28 May 2013 23:52:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305282352.r4SNq2jK002933@svn.freebsd.org> From: Glen Barber Date: Tue, 28 May 2013 23:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251086 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 28 May 2013 23:52:02 -0000 Author: gjb (doc,ports committer) Date: Tue May 28 23:52:01 2013 New Revision: 251086 URL: http://svnweb.freebsd.org/changeset/base/251086 Log: Remove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084. MFC after: 1 month X-MFC-With: r251084, r251085 Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Tue May 28 23:46:13 2013 (r251085) +++ head/share/man/man5/make.conf.5 Tue May 28 23:52:01 2013 (r251086) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2013 +.Dd May 28, 2013 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -177,16 +177,6 @@ Refer to for a list of recognized .Va CPUTYPE options. -.It Va CVS_UPDATE -.Pq Vt bool -Set this to use -.Xr cvs 1 -to update your -.Pa src , ports -and -.Pa doc -trees with -.Dq Li "make update" . .It Va CXXFLAGS .Pq Vt str Controls the compiler settings when compiling C++ code. @@ -255,61 +245,6 @@ Set this to not update the doc tree duri .Pq Vt bool Set this to not update the ports tree during .Dq Li "make update" . -.It Va SUP -.Pq Vt str -The location of the -.Xr csup 1 -or -.Xr cvsup 1 -command for -.Dq Li "make update" . -.It Va SUPFILE -.Pq Vt str -The first -.Ar supfile -to use when doing a -.Dq Li "make update" . -For example, -.Pa /usr/share/examples/cvsup/standard-supfile . -.It Va SUPFILE1 -.Pq Vt str -The second -.Ar supfile -to use when doing a -.Dq Li "make update" . -.It Va SUPFILE2 -.Pq Vt str -The third -.Ar supfile -to use when doing a -.Dq Li "make update" . -.It Va SUPFLAGS -.Pq Vt str -The flag for the -.Xr sup 1 -command when doing -.Dq Li "make update" . -This defaults to -.Op Fl g L Ar 2 . -.It Va SUPHOST -.Pq Vt str -The hostname of the sup server to use when doing -.Dq Li "make update" . -.It Va SUP_UPDATE -.Pq Vt bool -Set this to use -.Xr csup 1 -to update your -.Pa src , -and -.Pa ports -trees with -.Dq Li "make update" . -This option is deprecated. -Please use -.Va SVN_UPDATE -or -.Xr freebsd-update 8 . .It Va SVN_UPDATE .Pq Vt bool Set this to use From owner-svn-src-head@FreeBSD.ORG Wed May 29 00:19:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C18AD63; Wed, 29 May 2013 00:19:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF9B797; Wed, 29 May 2013 00:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0Jxad011757; Wed, 29 May 2013 00:19:59 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0JxLE011755; Wed, 29 May 2013 00:19:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305290019.r4T0JxLE011755@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 00:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251088 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 00:19:59 -0000 Author: des Date: Wed May 29 00:19:58 2013 New Revision: 251088 URL: http://svnweb.freebsd.org/changeset/base/251088 Log: Revert a local change that sets the default for UsePrivilegeSeparation to "sandbox" instead of "yes". In sandbox mode, the privsep child is unable to load additional libraries and will therefore crash when trying to take advantage of crypto offloading on CPUs that support it. Modified: head/crypto/openssh/servconf.c Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed May 29 00:18:12 2013 (r251087) +++ head/crypto/openssh/servconf.c Wed May 29 00:19:58 2013 (r251088) @@ -298,7 +298,7 @@ fill_default_server_options(ServerOption options->version_addendum = xstrdup(SSH_VERSION_FREEBSD); /* Turn privilege separation on by default */ if (use_privsep == -1) - use_privsep = PRIVSEP_ON; + use_privsep = PRIVSEP_NOSANDBOX; #ifndef HAVE_MMAP if (use_privsep && options->compression == 1) { From owner-svn-src-head@FreeBSD.ORG Wed May 29 00:32:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEEDD1E1; Wed, 29 May 2013 00:32:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFF8082B; Wed, 29 May 2013 00:32:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0WnPQ017335; Wed, 29 May 2013 00:32:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0Wntt017334; Wed, 29 May 2013 00:32:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305290032.r4T0Wntt017334@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 May 2013 00:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251089 - head/sys/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 00:32:49 -0000 Author: rmacklem Date: Wed May 29 00:32:49 2013 New Revision: 251089 URL: http://svnweb.freebsd.org/changeset/base/251089 Log: Add a patch analygous to r248567, r248581, r251079 to the old NFS client to avoid the panic reported in the PR by doing the vnode_pager_setsize() call after unlocking the mutex. PR: 177335 MFC after: 2 weeks Modified: head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Wed May 29 00:19:58 2013 (r251088) +++ head/sys/nfsclient/nfs_subs.c Wed May 29 00:32:49 2013 (r251089) @@ -463,6 +463,8 @@ nfs_loadattrcache(struct vnode **vpp, st struct timespec mtime, mtime_save; int v3 = NFS_ISV3(vp); int error = 0; + u_quad_t nsize; + int setnsize; md = *mdp; t1 = (mtod(md, caddr_t) + md->m_len) - *dposp; @@ -565,6 +567,8 @@ nfs_loadattrcache(struct vnode **vpp, st vap->va_filerev = 0; } np->n_attrstamp = time_second; + setnsize = 0; + nsize = 0; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -591,7 +595,8 @@ nfs_loadattrcache(struct vnode **vpp, st np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); + setnsize = 1; + nsize = vap->va_size; } else { np->n_size = vap->va_size; } @@ -628,6 +633,8 @@ nfs_loadattrcache(struct vnode **vpp, st KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, &np->n_vattr, 0); #endif mtx_unlock(&np->n_mtx); + if (setnsize) + vnode_pager_setsize(vp, nsize); out: #ifdef KDTRACE_HOOKS if (error) From owner-svn-src-head@FreeBSD.ORG Wed May 29 01:40:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF05A82E; Wed, 29 May 2013 01:40:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8815FB35; Wed, 29 May 2013 01:40:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T1eEuS040929; Wed, 29 May 2013 01:40:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T1eErx040928; Wed, 29 May 2013 01:40:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290140.r4T1eErx040928@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 01:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251090 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 01:40:14 -0000 Author: adrian Date: Wed May 29 01:40:13 2013 New Revision: 251090 URL: http://svnweb.freebsd.org/changeset/base/251090 Log: Shuffle around the cleanup unpause calls a bit. 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 Wed May 29 00:32:49 2013 (r251089) +++ head/sys/dev/ath/if_ath_tx.c Wed May 29 01:40:13 2013 (r251090) @@ -4156,7 +4156,9 @@ ath_tx_comp_cleanup_unaggr(struct ath_so * - Count the number of unacked frames, and let transmit completion * handle it later. * - * The caller is responsible for pausing the TID. + * The caller is responsible for pausing the TID and unpausing the + * TID if no cleanup was required. Otherwise the cleanup path will + * unpause the TID once the last hardware queued frame is completed. */ static void ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid, @@ -4214,12 +4216,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, bf = TAILQ_NEXT(bf, bf_list); } - /* The caller is required to pause the TID */ -#if 0 - /* Pause the TID */ - ath_tx_tid_pause(sc, atid); -#endif - /* * Calculate what hardware-queued frames exist based * on the current BAW size. Ie, what frames have been @@ -4238,14 +4234,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, INCR(tap->txa_start, IEEE80211_SEQ_RANGE); } - /* - * If cleanup is required, defer TID scheduling - * until all the HW queued packets have been - * sent. - */ - if (! atid->cleanup_inprogress) - ath_tx_tid_resume(sc, atid); - if (atid->cleanup_inprogress) DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: TID %d: cleanup needed: %d packets\n", @@ -5789,6 +5777,11 @@ ath_addba_stop(struct ieee80211_node *ni TAILQ_INIT(&bf_cq); ATH_TX_LOCK(sc); ath_tx_tid_cleanup(sc, an, tid, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! atid->cleanup_inprogress) + ath_tx_tid_resume(sc, atid); ATH_TX_UNLOCK(sc); /* Handle completing frames and fail them */ @@ -5830,6 +5823,11 @@ ath_tx_node_reassoc(struct ath_softc *sc ":", i); ath_tx_tid_cleanup(sc, an, i, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! tid->cleanup_inprogress) + ath_tx_tid_resume(sc, tid); } ATH_TX_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Wed May 29 01:54:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29C02A6F; Wed, 29 May 2013 01:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDD8C02; Wed, 29 May 2013 01:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T1sCk0046637; Wed, 29 May 2013 01:54:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T1sA0C046618; Wed, 29 May 2013 01:54:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305290154.r4T1sA0C046618@svn.freebsd.org> From: Ed Maste Date: Wed, 29 May 2013 01:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251091 - in head/lib/libc: mips/gen mips/net net powerpc64/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 01:54:13 -0000 Author: emaste Date: Wed May 29 01:54:10 2013 New Revision: 251091 URL: http://svnweb.freebsd.org/changeset/base/251091 Log: Remove clause 3 and 4 from TNF licenses Per the NetBSD Foundation statement Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license. Modified: head/lib/libc/mips/gen/longjmp.c head/lib/libc/mips/net/htonl.S head/lib/libc/mips/net/htons.S head/lib/libc/mips/net/ntohl.S head/lib/libc/mips/net/ntohs.S head/lib/libc/net/nsdispatch.c head/lib/libc/net/nslexer.l head/lib/libc/net/nsparser.y head/lib/libc/powerpc64/gen/fpgetmask.c head/lib/libc/powerpc64/gen/fpgetround.c head/lib/libc/powerpc64/gen/fpgetsticky.c head/lib/libc/powerpc64/gen/fpsetmask.c head/lib/libc/powerpc64/gen/fpsetround.c Modified: head/lib/libc/mips/gen/longjmp.c ============================================================================== --- head/lib/libc/mips/gen/longjmp.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/gen/longjmp.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/htonl.S ============================================================================== --- head/lib/libc/mips/net/htonl.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/htonl.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/htons.S ============================================================================== --- head/lib/libc/mips/net/htons.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/htons.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/ntohl.S ============================================================================== --- head/lib/libc/mips/net/ntohl.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/ntohl.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/mips/net/ntohs.S ============================================================================== --- head/lib/libc/mips/net/ntohs.S Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/mips/net/ntohs.S Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nsdispatch.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nslexer.l Wed May 29 01:54:10 2013 (r251091) @@ -16,13 +16,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/net/nsparser.y ============================================================================== --- head/lib/libc/net/nsparser.y Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/net/nsparser.y Wed May 29 01:54:10 2013 (r251091) @@ -16,13 +16,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetmask.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetmask.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetmask.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetround.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetround.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetround.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpgetsticky.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpgetsticky.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpgetsticky.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpsetmask.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpsetmask.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpsetmask.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/powerpc64/gen/fpsetround.c ============================================================================== --- head/lib/libc/powerpc64/gen/fpsetround.c Wed May 29 01:40:13 2013 (r251090) +++ head/lib/libc/powerpc64/gen/fpsetround.c Wed May 29 01:54:10 2013 (r251091) @@ -15,13 +15,6 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Wed May 29 04:21:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A061B409; Wed, 29 May 2013 04:21:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91F1E2D7; Wed, 29 May 2013 04:21:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4Lgo9099596; Wed, 29 May 2013 04:21:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4LgRc099595; Wed, 29 May 2013 04:21:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290421.r4T4LgRc099595@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 04:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 04:21:42 -0000 Author: adrian Date: Wed May 29 04:21:42 2013 New Revision: 251098 URL: http://svnweb.freebsd.org/changeset/base/251098 Log: Fix a false -> AH_FALSE. Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. It's been like this for a while. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed May 29 04:18:02 2013 (r251097) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Wed May 29 04:21:42 2013 (r251098) @@ -3554,7 +3554,7 @@ ar9300_init_cal_internal(struct ath_hal * no chip specific code for Jupiter/Posdeion except for register names. */ if (txiqcal_success_flag) { - ar9300_tx_iq_cal_post_proc(ah,ichan, 1, 1,is_cal_reusable,false); + ar9300_tx_iq_cal_post_proc(ah,ichan, 1, 1,is_cal_reusable, AH_FALSE); } } else { if (!txiqcal_success_flag) { From owner-svn-src-head@FreeBSD.ORG Wed May 29 05:10:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB4E2687; Wed, 29 May 2013 05:10:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE2AC9B4; Wed, 29 May 2013 05:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T5ABCJ015393; Wed, 29 May 2013 05:10:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T5ABTs015392; Wed, 29 May 2013 05:10:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305290510.r4T5ABTs015392@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 May 2013 05:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251099 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 05:10:11 -0000 Author: adrian Date: Wed May 29 05:10:11 2013 New Revision: 251099 URL: http://svnweb.freebsd.org/changeset/base/251099 Log: Turn the reassociate debug print into a DPRINTF. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 29 04:21:42 2013 (r251098) +++ head/sys/dev/ath/if_ath.c Wed May 29 05:10:11 2013 (r251099) @@ -5511,6 +5511,7 @@ ath_newassoc(struct ieee80211_node *ni, an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); ath_rate_newassoc(sc, an, isnew); + if (isnew && (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey && ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) @@ -5526,7 +5527,7 @@ ath_newassoc(struct ieee80211_node *ni, * marked as non-aggregate. */ if (! isnew) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; is_powersave=%d\n", __func__, ni->ni_macaddr, From owner-svn-src-head@FreeBSD.ORG Wed May 29 07:07:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B356D870; Wed, 29 May 2013 07:07:08 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 7D87FF88; Wed, 29 May 2013 07:07:07 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E316E917; Wed, 29 May 2013 09:02:48 +0200 (CEST) Date: Wed, 29 May 2013 09:09:53 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130529070952.GA1400@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <201305290019.r4T0JxLE011755@svn.freebsd.org> X-OS: 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 07:07:08 -0000 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 12:19:59AM +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Wed May 29 00:19:58 2013 > New Revision: 251088 > URL: http://svnweb.freebsd.org/changeset/base/251088 >=20 > Log: > Revert a local change that sets the default for UsePrivilegeSeparation = to > "sandbox" instead of "yes". In sandbox mode, the privsep child is unab= le > to load additional libraries and will therefore crash when trying to ta= ke > advantage of crypto offloading on CPUs that support it. Which library is needed for AES-NI? I don't see any engine in /usr/lib/ that implements AES-NI support. Could you be more specific? Also what is the exact difference between "sandbox" and "yes" settings? The reason I ask is because I plan to experiment with OpenSSH sandboxing to use Capsicum and Casper. > Modified: > head/crypto/openssh/servconf.c >=20 > Modified: head/crypto/openssh/servconf.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/crypto/openssh/servconf.c Wed May 29 00:18:12 2013 (r251087) > +++ head/crypto/openssh/servconf.c Wed May 29 00:19:58 2013 (r251088) > @@ -298,7 +298,7 @@ fill_default_server_options(ServerOption > options->version_addendum =3D xstrdup(SSH_VERSION_FREEBSD); > /* Turn privilege separation on by default */ > if (use_privsep =3D=3D -1) > - use_privsep =3D PRIVSEP_ON; > + use_privsep =3D PRIVSEP_NOSANDBOX; > =20 > #ifndef HAVE_MMAP > if (use_privsep && options->compression =3D=3D 1) { --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGlqcAACgkQForvXbEpPzQGOgCgtMJXt0yVntEo0ej5EZZVEzZq e8AAnRFOUbrteHLIVdBEEgFuT8ESmKq9 =HLoi -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE-- From owner-svn-src-head@FreeBSD.ORG Wed May 29 11:22:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E7CFD08; Wed, 29 May 2013 11:22:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 03D0CBD; Wed, 29 May 2013 11:22:12 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9FEE65C44; Wed, 29 May 2013 13:22:05 +0200 (CEST) Message-ID: <51A5E4DE.5060007@FreeBSD.org> Date: Wed, 29 May 2013 13:22:06 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Thunderbird/22.0 MIME-Version: 1.0 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 References: <201305290421.r4T4LgRc099595@svn.freebsd.org> In-Reply-To: <201305290421.r4T4LgRc099595@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 11:22:13 -0000 On 2013-05-29 06:21, Adrian Chadd wrote: > Author: adrian > Date: Wed May 29 04:21:42 2013 > New Revision: 251098 > URL: http://svnweb.freebsd.org/changeset/base/251098 > > Log: > Fix a false -> AH_FALSE. > > Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. > It's been like this for a while. Because 'false' will be implicitly converted to an enum HAL_BOOL value. Adding a warning for such cases would result in a *lot* of noise, and probably many angry developers. ;-) Note that in C++, such a call would result in an error: "no known conversion from 'bool' to 'HAL_BOOL'". From owner-svn-src-head@FreeBSD.ORG Wed May 29 12:36:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF26E915; Wed, 29 May 2013 12:36:17 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 832D7899; Wed, 29 May 2013 12:36:17 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 7D6007058; Wed, 29 May 2013 12:36:16 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id BDE7F4A7C8; Wed, 29 May 2013 14:36:17 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> Date: Wed, 29 May 2013 14:36:17 +0200 In-Reply-To: <20130529070952.GA1400@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 29 May 2013 09:09:53 +0200") Message-ID: <86zjve3qv2.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 12:36:17 -0000 Pawel Jakub Dawidek writes: > Which library is needed for AES-NI? I don't see any engine in /usr/lib/ > that implements AES-NI support. Could you be more specific? Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood his report. I just ran through the steps to reproduce the issue, and what happens is that a CRIOGET ioctl cal (which is supposed to allocate and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) 90344 sshd RET setrlimit 0 [...] 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) 90344 sshd RET ioctl -1 errno 24 Too many open files Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: May 29 12:10:37 zoo2 kernel: ktrace write failed, errno 27, tracing stopped= =20 To reproduce: # ktrace -tcnstuy -di env LD_UTRACE=3Dyes /usr/sbin/sshd -oUsePrivilegeSepa= ration=3Dsandbox -Dddd -oPort=3D2222 -oListenAddress=3Dlocalhost followed by % ssh -c aes128-cbc -p 2222 localhost on a machine with an AESNI-capable CPU and aesni.ko loaded. > Also what is the exact difference between "sandbox" and "yes" settings? "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means a bunch of rlimit settings. > The reason I ask is because I plan to experiment with OpenSSH sandboxing > to use Capsicum and Casper. You still have the patches I sent you? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed May 29 12:40:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A1F8B8A; Wed, 29 May 2013 12:40:29 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5490B8ED; Wed, 29 May 2013 12:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TCeT1T071941; Wed, 29 May 2013 12:40:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TCeTxN071940; Wed, 29 May 2013 12:40:29 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305291240.r4TCeTxN071940@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 12:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251101 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 12:40:29 -0000 Author: des Date: Wed May 29 12:40:28 2013 New Revision: 251101 URL: http://svnweb.freebsd.org/changeset/base/251101 Log: Forced commit to note that the sandbox issue was not about libraries, as I erroneously stated in the commit log, but about a CRIOGET ioctl failing due to a preceding setrlimit(RLIMIT_NOFILES, 0) call. Modified: head/crypto/openssh/servconf.c Modified: head/crypto/openssh/servconf.c ============================================================================== From owner-svn-src-head@FreeBSD.ORG Wed May 29 12:44:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F068EAB for ; Wed, 29 May 2013 12:44:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7D673969 for ; Wed, 29 May 2013 12:44:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4TCiMjR025271 for ; Wed, 29 May 2013 12:44:22 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4TCiMoN025266 for svn-src-head@freebsd.org; Wed, 29 May 2013 12:44:22 GMT (envelope-from bdrewery) Received: (qmail 94931 invoked from network); 29 May 2013 07:44:20 -0500 Received: from unknown (HELO ?10.10.1.133?) (freebsd@shatow.net@10.10.1.133) by sweb.xzibition.com with ESMTPA; 29 May 2013 07:44:20 -0500 Message-ID: <51A5F819.4070507@FreeBSD.org> Date: Wed, 29 May 2013 07:44:09 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> In-Reply-To: <86zjve3qv2.fsf@nine.des.no> X-Enigmail-Version: 1.5.1 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2TMUJULUDELVGEMIEOMUI" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 12:44:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TMUJULUDELVGEMIEOMUI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 5/29/2013 7:36 AM, Dag-Erling Sm=C3=B8rgrav wrote: > Pawel Jakub Dawidek writes: >> Which library is needed for AES-NI? I don't see any engine in /usr/lib= / >> that implements AES-NI support. Could you be more specific? >=20 > Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood > his report. I just ran through the steps to reproduce the issue, and > what happens is that a CRIOGET ioctl cal (which is supposed to allocate= > and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): >=20 > 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) > 90344 sshd RET setrlimit 0 This is as far as I went. I wasn't able to debug it further with the RLIMIT_FSIZE set, as removing it allowed the functionality to work. I incorrectly assumed it was due to dynamic library loading later. Sorry for the miscommunication. > [...] > 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) > 90344 sshd RET ioctl -1 errno 24 Too many open files >=20 > Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in > sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: --=20 Regards, Bryan Drewery ------enig2TMUJULUDELVGEMIEOMUI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRpfgaAAoJEG54KsA8mwz5Kw0P/21pL5DbSsQpf60NkqJ//upY EgZ9VBkHl7TCtzd/b16OHSw618zgVYDuSCRGmalsZbHxn4v4Q98CYtzo3/O5OxKK 7g22bf1pyBE9XNHcVPFbcNGqKbRSz3ZHEgMb7n1oLgFeWwvtB/mYAqlCT77sSDje haUEkEzClRS4KZklxN0v7CEteCgHz4hfPXbBJNplxcOUqZxbwkRL2l/Mb+7hf0bU 2j0xtkxRhMI5SUUMw7zuRPkNwS+ogkQetRGrUp4qakzGpcnI8xMEYHOvonQc0XP9 +SEMt6bkacQb0pHpfTB5j/BAhXSQUr/4OjI6EIu2CJbbodRY4EKjMyqIGvRVFZQR IvExf9GNS5o3M7W7uI4KGNzr38XnXepBbDmVrpPRgm30ffa0le+7i7G+E/WnTCNp TNtg68ZD5SZVfJGB7NWu68n0n6nJt2PFC1gyFTWE23aKenlubxsigf7U/EPXnmVg iNzXqVsuzrib4wrbK5ZvZanNoXPsrTdaoCadGl/z2FflBEPqAcDWQyxFI6SaVe+b gvK/qilUO0jQn7hTHz97iGnlXjJFaiVpZQ485ZB9QsICYfJVW3nr08WRIGHpi3yP PRKaaiFA/GrXVn1P/4g+jhLIOIB1ccZkuy+a7jKysh4lX90A4l/lXuous3njkQdE VjbL4ufuBkaUqZVvog8B =Bg5Q -----END PGP SIGNATURE----- ------enig2TMUJULUDELVGEMIEOMUI-- From owner-svn-src-head@FreeBSD.ORG Wed May 29 12:48:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D97827B; Wed, 29 May 2013 12:48:01 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 5751B9C2; Wed, 29 May 2013 12:48:01 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 763A6A69; Wed, 29 May 2013 14:43:47 +0200 (CEST) Date: Wed, 29 May 2013 14:50:52 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130529125052.GA1383@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <86zjve3qv2.fsf@nine.des.no> X-OS: 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, bdrewery@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 12:48:01 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 02:36:17PM +0200, Dag-Erling Sm=F8rgrav wrote: > Pawel Jakub Dawidek writes: > > Which library is needed for AES-NI? I don't see any engine in /usr/lib/ > > that implements AES-NI support. Could you be more specific? >=20 > Ah, you're right. Bryan (cc:ed) did the analysis and I misunderstood > his report. I just ran through the steps to reproduce the issue, and > what happens is that a CRIOGET ioctl cal (which is supposed to allocate > and return a file descriptor) fails due to setrlimit(RLIMIT_FSIZE, 0): >=20 > 90344 sshd CALL setrlimit(RLIMIT_NOFILE,0x7fffffffca10) > 90344 sshd RET setrlimit 0 > [...] > 90344 sshd CALL ioctl(0x3,CRIOGET,0x7fffffffcb4c) > 90344 sshd RET ioctl -1 errno 24 Too many open files >=20 > Note that you have to remove the setrlimit(RLIMIT_FSIZE, 0) call in > sandbox-rlimit.c to debug this, otherwise ktrace stops at that point: >=20 > May 29 12:10:37 zoo2 kernel: ktrace write failed, errno 27, tracing stopp= ed=20 >=20 > To reproduce: >=20 > # ktrace -tcnstuy -di env LD_UTRACE=3Dyes /usr/sbin/sshd -oUsePrivilegeSe= paration=3Dsandbox -Dddd -oPort=3D2222 -oListenAddress=3Dlocalhost >=20 > followed by >=20 > % ssh -c aes128-cbc -p 2222 localhost >=20 > on a machine with an AESNI-capable CPU and aesni.ko loaded. AES-NI doesn't have to go through kernel at all and doing so is much slower. Not sure if our OpenSSL version already has native AES-NI support. If not it would be best to upgrade it. This would fix AES-NI at least. Other crypto HW that do need kernel driver would still need something here. I wonder if CRIOGET can't be done before setting rlimit. How does it work on OpenBSD then? > > Also what is the exact difference between "sandbox" and "yes" settings? >=20 > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means > a bunch of rlimit settings. I thought that simple "yes" setting does chroot to /var/empty, drops privileges to sshd user/group and sets rlimit? I'm trying to figure out the difference between those two settings. > > The reason I ask is because I plan to experiment with OpenSSH sandboxing > > to use Capsicum and Casper. >=20 > You still have the patches I sent you? Probably somewhere in my INBOX. If you have them handy can you please resend them? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGl+awACgkQForvXbEpPzSQ2QCg4Rd8ricVkUU7xRd+8/sEWdv3 TAwAoIJZDDC2W3fUllt4f62suXTzxWuu =a7Dr -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-svn-src-head@FreeBSD.ORG Wed May 29 13:36:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A767DA9B; Wed, 29 May 2013 13:36:33 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 999DFED1; Wed, 29 May 2013 13:36:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TDaX2B092028; Wed, 29 May 2013 13:36:33 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TDaXwj092027; Wed, 29 May 2013 13:36:33 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305291336.r4TDaXwj092027@svn.freebsd.org> From: Chris Rees Date: Wed, 29 May 2013 13:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251102 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 13:36:33 -0000 Author: crees (doc,ports committer) Date: Wed May 29 13:36:33 2013 New Revision: 251102 URL: http://svnweb.freebsd.org/changeset/base/251102 Log: Add my entry. Approved by: bcr, gjb (mentors) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Wed May 29 12:40:28 2013 (r251101) +++ head/share/misc/committers-doc.dot Wed May 29 13:36:33 2013 (r251102) @@ -56,6 +56,7 @@ blackend [label="Marc Fonvieille\nblacke brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] +crees [label="Chris Rees\ncrees@FreeBSD.org\n2013/05/27"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] dru [label="Dru Lavigne\ndru@FreeBSD.org\n2013/01/22"] @@ -95,6 +96,7 @@ bcr -> gavin bcr -> wblock bcr -> eadler bcr -> dru +bcr -> crees blackend -> ale @@ -120,6 +122,7 @@ gabor -> ebrandi gjb -> wblock gjb -> rene gjb -> dru +gjb -> crees hrs -> ryusuke hrs -> dru From owner-svn-src-head@FreeBSD.ORG Wed May 29 15:03:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C3D21C2; Wed, 29 May 2013 15:03:11 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 139D0ADA; Wed, 29 May 2013 15:03:10 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 64B46730E; Wed, 29 May 2013 15:03:04 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id F0ADE4AA3D; Wed, 29 May 2013 17:03:05 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r251088 - head/crypto/openssh References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> <20130529125052.GA1383@garage.freebsd.pl> Date: Wed, 29 May 2013 17:03:05 +0200 In-Reply-To: <20130529125052.GA1383@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 29 May 2013 14:50:52 +0200") Message-ID: <867gih4ymu.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, bdrewery@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 15:03:11 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Pawel Jakub Dawidek writes: > AES-NI doesn't have to go through kernel at all and doing so is much > slower. Not sure if our OpenSSL version already has native AES-NI > support. If not it would be best to upgrade it. This would fix AES-NI > at least. Other crypto HW that do need kernel driver would still need > something here. I wonder if CRIOGET can't be done before setting rlimit. The CRIOGET ioctl call happens deep inside OpenSSL. There may be a way to pre-initialize the AES engine, but the unprivileged child doesn't know which engine to use until after it's sandboxed. > How does it work on OpenBSD then? IIUC, they have sandboxing facilities in the base system and use those instead of the extremely rudimentary rlimit-based implementation that we use. > > > Also what is the exact difference between "sandbox" and "yes" setting= s? > > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case means > > a bunch of rlimit settings. > I thought that simple "yes" setting does chroot to /var/empty, drops > privileges to sshd user/group and sets rlimit? I'm trying to figure out > the difference between those two settings. In our case, the only difference is that "sandbox" uses setrlimit() to prevent the unprivileged child from forking, opening files or appending to open files. > > > The reason I ask is because I plan to experiment with OpenSSH > > > sandboxing to use Capsicum and Casper. > > You still have the patches I sent you? > Probably somewhere in my INBOX. If you have them handy can you please > resend them? Attached. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=openssh-capsicum.diff Content-Transfer-Encoding: quoted-printable Index: crypto/openssh/servconf.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 --- crypto/openssh/servconf.c (revision 237273) +++ crypto/openssh/servconf.c (working copy) @@ -320,7 +320,7 @@ =20 /* Turn privilege separation on by default */ if (use_privsep =3D=3D -1) - use_privsep =3D PRIVSEP_ON; + use_privsep =3D PRIVSEP_SANDBOX; =20 #ifndef HAVE_MMAP if (use_privsep && options->compression =3D=3D 1) { Index: crypto/openssh/sandbox-rlimit.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 --- crypto/openssh/sandbox-rlimit.c (revision 237273) +++ crypto/openssh/sandbox-rlimit.c (working copy) @@ -32,17 +32,19 @@ #include =20 #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 /* Minimal sandbox that sets zero nfiles, nprocs and filesize rlimits */ =20 struct ssh_sandbox { + struct monitor *monitor; pid_t child_pid; }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -52,6 +54,7 @@ */ debug3("%s: preparing rlimit sandbox", __func__); box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; box->child_pid =3D 0; =20 return box; Index: crypto/openssh/sshd.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 --- crypto/openssh/sshd.c (revision 237273) +++ crypto/openssh/sshd.c (working copy) @@ -632,6 +632,14 @@ #endif } =20 +#if 1 +#include +#include +#include +#include +#include +#endif + static int privsep_preauth(Authctxt *authctxt) { @@ -645,7 +653,7 @@ pmonitor->m_pkex =3D &xxx_kex; =20 if (use_privsep =3D=3D PRIVSEP_SANDBOX) - box =3D ssh_sandbox_init(); + box =3D ssh_sandbox_init(pmonitor); pid =3D fork(); if (pid =3D=3D -1) { fatal("fork of unprivileged child failed"); @@ -677,6 +685,27 @@ ssh_sandbox_parent_finish(box); return 1; } else { +#if 1 + do { + struct rlimit rlim_infinity =3D { RLIM_INFINITY, RLIM_INFINITY }; + char ktfn[1024]; + int ktfd, ret; + snprintf(ktfn, sizeof ktfn, "/tmp/sshd.ktrace", (unsigned long)getpid()= ); + ktfd =3D open(ktfn, O_RDWR|O_CREAT|O_TRUNC, 0640); + if (ktfd =3D=3D -1) { + error("%s: truncate(): %s", __func__, strerror(errno)); + } else { + close(ktfd); + ktrace(ktfn, KTROP_SET, KTRFAC_SYSCALL, getpid()); + ret =3D ktrace(ktfn, KTROP_SET, + KTRFAC_SYSCALL|KTRFAC_SYSRET|KTRFAC_NAMEI|KTRFAC_PSIG|KTRFAC_STRUC= T|KTRFAC_CAPFAIL, + getpid()); + if (ret =3D=3D -1) + error("%s: ktrace(): %s", __func__, strerror(errno)); + } + setrlimit(RLIMIT_CORE, &rlim_infinity); + } while (0); +#endif /* child */ close(pmonitor->m_sendfd); close(pmonitor->m_log_recvfd); Index: crypto/openssh/sandbox-darwin.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 --- crypto/openssh/sandbox-darwin.c (revision 237273) +++ crypto/openssh/sandbox-darwin.c (working copy) @@ -30,17 +30,19 @@ #include =20 #include "log.h" +#include "monitor.h" #include "sandbox.h" #include "xmalloc.h" =20 /* Darwin/OS X sandbox */ =20 struct ssh_sandbox { + struct monitor *monitor; pid_t child_pid; }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -50,6 +52,7 @@ */ debug3("%s: preparing Darwin sandbox", __func__); box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; box->child_pid =3D 0; =20 return box; Index: crypto/openssh/sshd_config.5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sshd_config.5 (revision 237273) +++ crypto/openssh/sshd_config.5 (working copy) @@ -1083,14 +1083,14 @@ the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. -The default is -.Dq yes . If .Cm UsePrivilegeSeparation is set to .Dq sandbox then the pre-authentication unprivileged process is subject to additional restrictions. +The default is +.Dq sandbox . .It Cm VersionAddendum Specifies a string to append to the regular version string to identify OS- or site-specific modifications. Index: crypto/openssh/sshd_config =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/sshd_config (revision 237273) +++ crypto/openssh/sshd_config (working copy) @@ -103,7 +103,7 @@ #PrintLastLog yes #TCPKeepAlive yes #UseLogin no -#UsePrivilegeSeparation yes +#UsePrivilegeSeparation sandbox #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 Index: crypto/openssh/sandbox-capsicum.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 --- crypto/openssh/sandbox-capsicum.c (revision 0) +++ crypto/openssh/sandbox-capsicum.c (working copy) @@ -0,0 +1,96 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 Dag-Erling Sm=C3=B8rgrav + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "includes.h" + +#ifdef SANDBOX_CAPSICUM + +#include +#include + +#include +#include +#include + +#include "log.h" +#include "monitor.h" +#include "ssh-sandbox.h" +#include "xmalloc.h" + +/* Capsicum-based sandbox */ + +struct ssh_sandbox { + struct monitor *monitor; + pid_t child_pid; +}; + +struct ssh_sandbox * +ssh_sandbox_init(struct monitor *monitor) +{ + struct ssh_sandbox *box; + + debug3("%s: preparing Capsicum sandbox", __func__); + box =3D xcalloc(1, sizeof(*box)); + box->monitor =3D monitor; + box->child_pid =3D 0; + + return box; +} + +static int +ssh_child_limitfd(int fd, cap_rights_t rights) +{ + int cd, serrno; + + if ((cd =3D cap_new(fd, rights)) =3D=3D -1) + return -1; + if (dup2(cd, fd) =3D=3D -1) { + serrno =3D errno; + close(cd); + errno =3D serrno; + return -1; + } + close(cd); + return 0; +} + +void +ssh_sandbox_child(struct ssh_sandbox *box) +{ + int cd; + + if (ssh_child_limitfd(box->monitor->m_recvfd, CAP_READ|CAP_WRITE|CAP_SEEK= ) =3D=3D -1) + fatal("%s: failed to wrap the network socket", __func__); + if (ssh_child_limitfd(box->monitor->m_log_sendfd, CAP_WRITE|CAP_SEEK) =3D= =3D -1) + fatal("%s: failed to wrap the logging socket", __func__); + cap_enter(); +} + +void +ssh_sandbox_parent_finish(struct ssh_sandbox *box) +{ + free(box); + debug3("%s: finished", __func__); +} + +void +ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid) +{ + box->child_pid =3D child_pid; +} + +#endif /* SANDBOX_CAPSICUM */ Index: crypto/openssh/sandbox-null.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 --- crypto/openssh/sandbox-null.c (revision 237273) +++ crypto/openssh/sandbox-null.c (working copy) @@ -29,6 +29,7 @@ #include =20 #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 @@ -39,7 +40,7 @@ }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; =20 @@ -48,6 +49,7 @@ * to return non-NULL to satisfy the API. */ box =3D xcalloc(1, sizeof(*box)); + (void)monitor; return box; } =20 Index: crypto/openssh/ssh-sandbox.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/ssh-sandbox.h (revision 237273) +++ crypto/openssh/ssh-sandbox.h (working copy) @@ -15,9 +15,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ =20 +struct monitor; struct ssh_sandbox; =20 -struct ssh_sandbox *ssh_sandbox_init(void); +struct ssh_sandbox *ssh_sandbox_init(struct monitor *); void ssh_sandbox_child(struct ssh_sandbox *); void ssh_sandbox_parent_finish(struct ssh_sandbox *); void ssh_sandbox_parent_preauth(struct ssh_sandbox *, pid_t); Index: crypto/openssh/config.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- crypto/openssh/config.h (revision 237273) +++ crypto/openssh/config.h (working copy) @@ -219,6 +219,12 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_BSTRING_H */ =20 +/* Define to 1 if you have the `cap_enter' function. */ +#define HAVE_CAP_ENTER 1 + +/* Capsicum Capability Mode */ +#define HAVE_CAP_MODE 1 + /* Define to 1 if you have the `clock' function. */ #define HAVE_CLOCK 1 =20 @@ -1342,6 +1348,9 @@ /* read(1) can return 0 for a non-closed fd */ /* #undef PTY_ZEROREAD */ =20 +/* Sandbox using Capsicum */ +#define SANDBOX_CAPSICUM 1 + /* Sandbox using Darwin sandbox_init(3) */ /* #undef SANDBOX_DARWIN */ =20 @@ -1349,11 +1358,14 @@ /* #undef SANDBOX_NULL */ =20 /* Sandbox using setrlimit(2) */ -#define SANDBOX_RLIMIT 1 +/* #undef SANDBOX_RLIMIT */ =20 /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ =20 +/* Sandbox using Capsicum */ +#define SANDBOX_CAPSICUM 1 + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ =20 Index: crypto/openssh/sandbox-systrace.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 --- crypto/openssh/sandbox-systrace.c (revision 237273) +++ crypto/openssh/sandbox-systrace.c (working copy) @@ -38,6 +38,7 @@ =20 #include "atomicio.h" #include "log.h" +#include "monitor.h" #include "ssh-sandbox.h" #include "xmalloc.h" =20 @@ -75,7 +76,7 @@ }; =20 struct ssh_sandbox * -ssh_sandbox_init(void) +ssh_sandbox_init(struct monitor *monitor) { struct ssh_sandbox *box; int s[2]; @@ -88,6 +89,7 @@ box->parent_sock =3D s[1]; box->systrace_fd =3D -1; box->child_pid =3D 0; + (void)monitor; =20 return box; } Index: secure/usr.sbin/sshd/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 --- secure/usr.sbin/sshd/Makefile (revision 237273) +++ secure/usr.sbin/sshd/Makefile (working copy) @@ -17,7 +17,8 @@ loginrec.c auth-pam.c auth-shadow.c auth-sia.c md5crypt.c \ sftp-server.c sftp-common.c \ roaming_common.c roaming_serv.c \ - sandbox-null.c sandbox-rlimit.c sandbox-systrace.c sandbox-darwin.c + sandbox-null.c sandbox-rlimit.c sandbox-systrace.c sandbox-darwin.c \ + sandbox-capsicum.c =20 # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile SRCS+=3D gss-genr.c --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Wed May 29 16:51:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7E60E58; Wed, 29 May 2013 16:51:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A91F4953; Wed, 29 May 2013 16:51:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TGp3QZ061692; Wed, 29 May 2013 16:51:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TGp3wU061691; Wed, 29 May 2013 16:51:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305291651.r4TGp3wU061691@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 29 May 2013 16:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251103 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 16:51:03 -0000 Author: marcel Date: Wed May 29 16:51:03 2013 New Revision: 251103 URL: http://svnweb.freebsd.org/changeset/base/251103 Log: Don't assign the copyright to the FreeBSD foundation for the years this file is in FreeBSD. There's formality to this that hasn't happened and Juniper is perfectly fine with being the holder. Discussed with: eadler, imp, jhb Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Wed May 29 13:36:33 2013 (r251102) +++ head/sys/mips/mips/db_trace.c Wed May 29 16:51:03 2013 (r251103) @@ -1,5 +1,4 @@ /*- - * Copyright (c) 2008-2013 The FreeBSD Foundation * Copyright (c) 2004-2005, Juniper Networks, Inc. * All rights reserved. * From owner-svn-src-head@FreeBSD.ORG Wed May 29 17:58:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97376415; Wed, 29 May 2013 17:58:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-f54.google.com (mail-qe0-f54.google.com [209.85.128.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2B546D33; Wed, 29 May 2013 17:58:44 +0000 (UTC) Received: by mail-qe0-f54.google.com with SMTP id i11so5372524qej.27 for ; Wed, 29 May 2013 10:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OGayFVCphYUme3bF5MJIJUURSvf0rWwlV8nmi5ywoag=; b=eFwh8pjhyQP8ZU6qrjzorezXobXRdwClIcQAZTU0TpGM+FYdpeDRPfHJEZxIZxaYAo fI7Q96mX2Bp2Gd+AejicjEn02yygG+FrckH9UIdBN6Oqe2Eew55NPVwB++mZg7jQubBs Fh4rT3q3YeAj/we4VBxtEyv11u9+PHMhe2un6EGMDijjbncxcQYDq9jPgivX3EwZkzD2 sF1N8V6iM7znQF/mANsoa6M3u39NU3onfx3I2A3DOtfl2b/X0H8tb5ptHs+qucs0TnxQ yCHuchoGNiSoIGwrD6gC58am0w7KvYOwHJf7kWoILkSaTcdbqWk4fHMm73hQmqvKdM8r 19yQ== MIME-Version: 1.0 X-Received: by 10.224.52.212 with SMTP id j20mr4187754qag.64.1369850324434; Wed, 29 May 2013 10:58:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.199.66 with HTTP; Wed, 29 May 2013 10:58:44 -0700 (PDT) In-Reply-To: <51A5E4DE.5060007@FreeBSD.org> References: <201305290421.r4T4LgRc099595@svn.freebsd.org> <51A5E4DE.5060007@FreeBSD.org> Date: Wed, 29 May 2013 10:58:44 -0700 X-Google-Sender-Auth: Cgchrs8qADglhFfA0EPufdgnb2U Message-ID: Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 17:58:45 -0000 No, it actually failed to compile at all on some older 9-stable laptops.. Hence my confusion. Adrian On 29 May 2013 04:22, Dimitry Andric wrote: > On 2013-05-29 06:21, Adrian Chadd wrote: >> >> Author: adrian >> Date: Wed May 29 04:21:42 2013 >> New Revision: 251098 >> URL: http://svnweb.freebsd.org/changeset/base/251098 >> >> Log: >> Fix a false -> AH_FALSE. >> >> Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno. >> It's been like this for a while. > > > Because 'false' will be implicitly converted to an enum HAL_BOOL value. > Adding a warning for such cases would result in a *lot* of noise, and > probably many angry developers. ;-) > > Note that in C++, such a call would result in an error: "no known > conversion from 'bool' to 'HAL_BOOL'". > From owner-svn-src-head@FreeBSD.ORG Wed May 29 19:17:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 686C0CBD; Wed, 29 May 2013 19:17:00 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B18B20D; Wed, 29 May 2013 19:17:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TJH02R012711; Wed, 29 May 2013 19:17:00 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TJH05P012710; Wed, 29 May 2013 19:17:00 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305291917.r4TJH05P012710@svn.freebsd.org> From: Chris Rees Date: Wed, 29 May 2013 19:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251107 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 19:17:00 -0000 Author: crees (doc,ports committer) Date: Wed May 29 19:16:59 2013 New Revision: 251107 URL: http://svnweb.freebsd.org/changeset/base/251107 Log: Make the instruction order for buildworld agree with UPDATING and the Handbook. Reviewed by: imp, bdrewery, netchild Approved by: gjb (mentor) Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed May 29 17:31:34 2013 (r251106) +++ head/Makefile Wed May 29 19:16:59 2013 (r251107) @@ -65,8 +65,8 @@ # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `mergemaster -p' # 7. `make installworld' -# 8. `make delete-old' -# 9. `mergemaster' (you may wish to use -i, along with -U or -F). +# 8. `mergemaster' (you may wish to use -i, along with -U or -F). +# 9. `make delete-old' # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) # From owner-svn-src-head@FreeBSD.ORG Wed May 29 19:41:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4DBE6EC; Wed, 29 May 2013 19:41:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95491349; Wed, 29 May 2013 19:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TJfbfR022031; Wed, 29 May 2013 19:41:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TJfaWN022025; Wed, 29 May 2013 19:41:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305291941.r4TJfaWN022025@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 29 May 2013 19:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251108 - in head/contrib/atf/atf-c++: . detail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 19:41:37 -0000 Author: marcel Date: Wed May 29 19:41:36 2013 New Revision: 251108 URL: http://svnweb.freebsd.org/changeset/base/251108 Log: Modify atf::fs::path::get_process_helpers_path API to properly handle pathing with detail/ tests. Based on patch pushed upstream to ATF project. Obtained from: Garrett Cooper Modified: head/contrib/atf/atf-c++/check_test.cpp head/contrib/atf/atf-c++/detail/process_test.cpp head/contrib/atf/atf-c++/detail/test_helpers.cpp head/contrib/atf/atf-c++/detail/test_helpers.hpp Modified: head/contrib/atf/atf-c++/check_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:41:36 2013 (r251108) @@ -61,7 +61,7 @@ std::auto_ptr< atf::check::check_result do_exec(const atf::tests::tc* tc, const char* helper_name) { std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(*tc).str()); + argv.push_back(get_process_helpers_path(*tc, false).str()); argv.push_back(helper_name); std::cout << "Executing " << argv[0] << " " << argv[1] << "\n"; @@ -74,7 +74,7 @@ std::auto_ptr< atf::check::check_result do_exec(const atf::tests::tc* tc, const char* helper_name, const char *carg2) { std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(*tc).str()); + argv.push_back(get_process_helpers_path(*tc, false).str()); argv.push_back(helper_name); argv.push_back(carg2); std::cout << "Executing " << argv[0] << " " << argv[1] << " " Modified: head/contrib/atf/atf-c++/detail/process_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:41:36 2013 (r251108) @@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::t using atf::process::exec; std::vector< std::string > argv; - argv.push_back(get_process_helpers_path(tc).leaf_name()); + argv.push_back(get_process_helpers_path(tc, true).leaf_name()); argv.push_back(helper_name); - return exec(get_process_helpers_path(tc), + return exec(get_process_helpers_path(tc, true), atf::process::argv_array(argv), atf::process::stream_inherit(), atf::process::stream_inherit()); Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp ============================================================================== --- head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:41:36 2013 (r251108) @@ -82,10 +82,14 @@ header_check(const char *hdrname) } atf::fs::path -get_process_helpers_path(const atf::tests::tc& tc) +get_process_helpers_path(const atf::tests::tc& tc, bool is_detail) { - return atf::fs::path(tc.get_config_var("srcdir")) / - ".." / "atf-c" / "detail" / "process_helpers"; + if (is_detail) + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / ".." / "atf-c" / "detail" / "process_helpers"; + else + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / "atf-c" / "detail" / "process_helpers"; } bool Modified: head/contrib/atf/atf-c++/detail/test_helpers.hpp ============================================================================== --- head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:16:59 2013 (r251107) +++ head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:41:36 2013 (r251108) @@ -86,7 +86,7 @@ class tc; void header_check(const char*); void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bool); -atf::fs::path get_process_helpers_path(const atf::tests::tc&); +atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool); bool grep_file(const char*, const char*); bool grep_string(const std::string&, const char*); From owner-svn-src-head@FreeBSD.ORG Wed May 29 19:51:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C607FA99; Wed, 29 May 2013 19:51:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 91196393; Wed, 29 May 2013 19:51:43 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id uo1so9679766pbc.15 for ; Wed, 29 May 2013 12:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=Q/PLtYWLU90UeTusCaQzkxBHgU2f8oVhEVdyQURqOxM=; b=sn2JBKofCQ1O4rhiCgZmWP7+QBOB6pYdg2awPHsbqfbzoDKdbGRrrHa0N4YufPZaRD KEA3m/wDMTULmlDKd/fyyjJwrYsQ2EJLcI7FxGk7suhPoMR6K+GNI/lU6rzUD/wz7qlC osF4f0YNV8lCoSHjtxnVhk+Kmq2x+helh8qL6yrQ1sRvUwnKqwUfe6Ja7xlHT/oDl7Qu LD8e/MZENYTB3vpvtZYbrydlcXxXdg5IxBJHSEywljaYtJxgs2DjHtFtOPfdkGuAsh02 pW/hmm3qBP4NBwP9uWTG2H8QxVJO4te4o5k1lasC+NjVN65FS/Fzgk/M64rLYVeGptob rwfQ== X-Received: by 10.66.163.5 with SMTP id ye5mr4986244pab.60.1369857103400; Wed, 29 May 2013 12:51:43 -0700 (PDT) Received: from [10.35.247.147] (mobile-166-147-083-100.mycingular.net. [166.147.83.100]) by mx.google.com with ESMTPSA id qh4sm41122327pac.8.2013.05.29.12.51.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 12:51:42 -0700 (PDT) References: <201305291941.r4TJfaWN022025@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201305291941.r4TJfaWN022025@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <27261F76-9F6D-4A1A-AB35-50E2F8DC9311@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r251108 - in head/contrib/atf/atf-c++: . detail Date: Wed, 29 May 2013 12:51:35 -0700 To: Marcel Moolenaar Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 19:51:43 -0000 Thanks for this! Please don't commit the change I attached earlier to share/= atf/Makefile though--it makes an integration test pass but it causes runtime= to go to a crawl when running atf-run; that's why my demo at BSDCan didn't w= ork ;(.. Sent from my iPhone On May 29, 2013, at 12:41 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Wed May 29 19:41:36 2013 > New Revision: 251108 > URL: http://svnweb.freebsd.org/changeset/base/251108 >=20 > Log: > Modify atf::fs::path::get_process_helpers_path API to properly > handle pathing with detail/ tests. Based on patch pushed upstream to > ATF project. >=20 > Obtained from: Garrett Cooper >=20 > Modified: > head/contrib/atf/atf-c++/check_test.cpp > head/contrib/atf/atf-c++/detail/process_test.cpp > head/contrib/atf/atf-c++/detail/test_helpers.cpp > head/contrib/atf/atf-c++/detail/test_helpers.hpp >=20 > Modified: head/contrib/atf/atf-c++/check_test.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:16:59 2013 = (r251107) > +++ head/contrib/atf/atf-c++/check_test.cpp Wed May 29 19:41:36 2013 = (r251108) > @@ -61,7 +61,7 @@ std::auto_ptr< atf::check::check_result=20 > do_exec(const atf::tests::tc* tc, const char* helper_name) > { > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(*tc).str()); > + argv.push_back(get_process_helpers_path(*tc, false).str()); > argv.push_back(helper_name); > std::cout << "Executing " << argv[0] << " " << argv[1] << "\n"; >=20 > @@ -74,7 +74,7 @@ std::auto_ptr< atf::check::check_result=20 > do_exec(const atf::tests::tc* tc, const char* helper_name, const char *car= g2) > { > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(*tc).str()); > + argv.push_back(get_process_helpers_path(*tc, false).str()); > argv.push_back(helper_name); > argv.push_back(carg2); > std::cout << "Executing " << argv[0] << " " << argv[1] << " " >=20 > Modified: head/contrib/atf/atf-c++/detail/process_test.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/process_test.cpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::t > using atf::process::exec; >=20 > std::vector< std::string > argv; > - argv.push_back(get_process_helpers_path(tc).leaf_name()); > + argv.push_back(get_process_helpers_path(tc, true).leaf_name()); > argv.push_back(helper_name); >=20 > - return exec(get_process_helpers_path(tc), > + return exec(get_process_helpers_path(tc, true), > atf::process::argv_array(argv), > atf::process::stream_inherit(), > atf::process::stream_inherit()); >=20 > Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/test_helpers.cpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -82,10 +82,14 @@ header_check(const char *hdrname) > } >=20 > atf::fs::path > -get_process_helpers_path(const atf::tests::tc& tc) > +get_process_helpers_path(const atf::tests::tc& tc, bool is_detail) > { > - return atf::fs::path(tc.get_config_var("srcdir")) / > - ".." / "atf-c" / "detail" / "process_helpers"; > + if (is_detail) > + return atf::fs::path(tc.get_config_var("srcdir")) / > + ".." / ".." / "atf-c" / "detail" / "process_helpers"; > + else > + return atf::fs::path(tc.get_config_var("srcdir")) / > + ".." / "atf-c" / "detail" / "process_helpers"; > } >=20 > bool >=20 > Modified: head/contrib/atf/atf-c++/detail/test_helpers.hpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:16:5= 9 2013 (r251107) > +++ head/contrib/atf/atf-c++/detail/test_helpers.hpp Wed May 29 19:41:3= 6 2013 (r251108) > @@ -86,7 +86,7 @@ class tc; >=20 > void header_check(const char*); > void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bo= ol); > -atf::fs::path get_process_helpers_path(const atf::tests::tc&); > +atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool); > bool grep_file(const char*, const char*); > bool grep_string(const std::string&, const char*); >=20 > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Wed May 29 20:36:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141CD88F; Wed, 29 May 2013 20:36:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06715832; Wed, 29 May 2013 20:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TKaqPv040498; Wed, 29 May 2013 20:36:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TKaqec040496; Wed, 29 May 2013 20:36:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305292036.r4TKaqec040496@svn.freebsd.org> From: Eitan Adler Date: Wed, 29 May 2013 20:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251109 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 20:36:53 -0000 Author: eadler Date: Wed May 29 20:36:51 2013 New Revision: 251109 URL: http://svnweb.freebsd.org/changeset/base/251109 Log: Add support for tethering on the iPhone 4S PR: usb/179078 Submitted by: Christopher Sean Hilton MFC After: 1 week Modified: head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Wed May 29 19:41:36 2013 (r251108) +++ head/sys/dev/usb/net/if_ipheth.c Wed May 29 20:36:51 2013 (r251109) @@ -161,6 +161,9 @@ static const STRUCT_USB_HOST_ID ipheth_d {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4S, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed May 29 19:41:36 2013 (r251108) +++ head/sys/dev/usb/usbdevs Wed May 29 20:36:51 2013 (r251109) @@ -1087,6 +1087,7 @@ product APPLE IPOD_TOUCH 0x1291 iPod Tou product APPLE IPHONE_3G 0x1292 iPhone 3G product APPLE IPHONE_3GS 0x1294 iPhone 3GS product APPLE IPHONE_4 0x1297 iPhone 4 +product APPLE IPHONE_4S 0x12a0 iPhone 4S product APPLE IPHONE_5 0x12a8 iPhone 5 product APPLE IPAD 0x129a iPad product APPLE ETHERNET 0x1402 Ethernet A1277 From owner-svn-src-head@FreeBSD.ORG Wed May 29 22:35:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D891BDCA; Wed, 29 May 2013 22:35:37 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id A0449D0D; Wed, 29 May 2013 22:35:37 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 30F86358C67; Thu, 30 May 2013 00:35:36 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 111DF28493; Thu, 30 May 2013 00:35:36 +0200 (CEST) Date: Thu, 30 May 2013 00:35:36 +0200 From: Jilles Tjoelker To: Eitan Adler Subject: Re: svn commit: r251078 - head/bin/sleep Message-ID: <20130529223535.GA11142@stack.nl> References: <201305282207.r4SM7We8065840@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 22:35:37 -0000 On Wed, May 29, 2013 at 01:32:05AM +0200, Eitan Adler wrote: > On 29 May 2013 00:07, Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue May 28 22:07:31 2013 > > New Revision: 251078 > > URL: http://svnweb.freebsd.org/changeset/base/251078 > > Log: > > sleep: Improve nanosleep() error handling: > > * Work around kernel bugs that cause a spurious [EINTR] return if a > > debugger (such as truss(1)) is attached. > The the fact that this is a workaround be noted in a comment so the > code may be removed when the bug is fixed? Good point. I will add a comment soon. I do not expect a complete fix for the kernel bug soon, though. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed May 29 23:56:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04A43D7A; Wed, 29 May 2013 23:56:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB549FA0; Wed, 29 May 2013 23:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TNun2v010095; Wed, 29 May 2013 23:56:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TNundR010094; Wed, 29 May 2013 23:56:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305292356.r4TNundR010094@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 May 2013 23:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251114 - head/sys/modules/ata/atacbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 29 May 2013 23:56:50 -0000 Author: marius Date: Wed May 29 23:56:49 2013 New Revision: 251114 URL: http://svnweb.freebsd.org/changeset/base/251114 Log: Fix a typo in r249213; the second bus_if.h should have been isa_if.h. Modified: head/sys/modules/ata/atacbus/Makefile Modified: head/sys/modules/ata/atacbus/Makefile ============================================================================== --- head/sys/modules/ata/atacbus/Makefile Wed May 29 22:30:29 2013 (r251113) +++ head/sys/modules/ata/atacbus/Makefile Wed May 29 23:56:49 2013 (r251114) @@ -4,6 +4,6 @@ KMOD= atacbus SRCS= ata-cbus.c -SRCS+= ata_if.h isa_if.h bus_if.h device_if.h bus_if.h +SRCS+= ata_if.h bus_if.h device_if.h isa_if.h .include From owner-svn-src-head@FreeBSD.ORG Thu May 30 00:11:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15B052BF; Thu, 30 May 2013 00:11:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07365AE; Thu, 30 May 2013 00:11:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U0BN8i016422; Thu, 30 May 2013 00:11:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U0BNX7016414; Thu, 30 May 2013 00:11:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305300011.r4U0BNX7016414@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 00:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251115 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 00:11:24 -0000 Author: marius Date: Thu May 30 00:11:22 2013 New Revision: 251115 URL: http://svnweb.freebsd.org/changeset/base/251115 Log: - Remove pointless returns. - Make cm_data a void pointer and cm_flags unsigned as appropriate. MFC after: 3 days Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac.c Thu May 30 00:11:22 2013 (r251115) @@ -379,8 +379,6 @@ aac_add_event(struct aac_softc *sc, stru event->ev_type); break; } - - return; } /* @@ -1631,8 +1629,6 @@ aac_map_command_sg(void *arg, bus_dma_se aac_requeue_ready(cm); } } - - return; } /* @@ -2362,7 +2358,6 @@ aac_timeout(struct aac_softc *sc) "longer running! code= 0x%x\n", code); } } - return; } /* @@ -3372,8 +3367,6 @@ aac_handle_aif(struct aac_softc *sc, str /* Wakeup any poll()ers */ selwakeuppri(&sc->rcv_select, PRIBIO); mtx_unlock(&sc->aac_aifq_lock); - - return; } /* @@ -3788,6 +3781,4 @@ aac_get_bus_info(struct aac_softc *sc) if (found) bus_generic_attach(sc->aac_dev); - - return; } Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac_cam.c Thu May 30 00:11:22 2013 (r251115) @@ -163,8 +163,6 @@ aac_cam_event(struct aac_softc *sc, stru event->ev_type); break; } - - return; } static int @@ -515,8 +513,6 @@ aac_cam_action(struct cam_sim *sim, unio aac_enqueue_ready(cm); aac_startio(cm->cm_sc); - - return; } static void @@ -625,8 +621,6 @@ aac_cam_complete(struct aac_command *cm) aac_release_command(cm); xpt_done(ccb); - - return; } static u_int32_t Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aac_disk.c Thu May 30 00:11:22 2013 (r251115) @@ -167,8 +167,6 @@ aac_disk_strategy(struct bio *bp) mtx_lock(&sc->ad_controller->aac_io_lock); aac_submit_bio(bp); mtx_unlock(&sc->ad_controller->aac_io_lock); - - return; } /* Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Wed May 29 23:56:49 2013 (r251114) +++ head/sys/dev/aac/aacvar.h Thu May 30 00:11:22 2013 (r251115) @@ -158,13 +158,13 @@ struct aac_command struct aac_fib *cm_fib; /* FIB associated with this * command */ u_int64_t cm_fibphys; /* bus address of the FIB */ - struct bio *cm_data; /* pointer to data in kernel + void *cm_data; /* pointer to data in kernel * space */ u_int32_t cm_datalen; /* data length */ bus_dmamap_t cm_datamap; /* DMA map for bio data */ struct aac_sg_table *cm_sgtable; /* pointer to s/g table in * command */ - int cm_flags; + u_int cm_flags; #define AAC_CMD_MAPPED (1<<0) /* command has had its data * mapped */ #define AAC_CMD_DATAIN (1<<1) /* command involves data moving @@ -182,7 +182,7 @@ struct aac_command #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ - void (* cm_complete)(struct aac_command *cm); + void (*cm_complete)(struct aac_command *cm); void *cm_private; time_t cm_timestamp; /* command creation time */ int cm_queue; From owner-svn-src-head@FreeBSD.ORG Thu May 30 00:22:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B8CB537; Thu, 30 May 2013 00:22:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0337710C; Thu, 30 May 2013 00:22:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U0M7xY020024; Thu, 30 May 2013 00:22:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U0M7rX020019; Thu, 30 May 2013 00:22:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305300022.r4U0M7rX020019@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 00:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251116 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 00:22:08 -0000 Author: marius Date: Thu May 30 00:22:07 2013 New Revision: 251116 URL: http://svnweb.freebsd.org/changeset/base/251116 Log: Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the same support for aacp(4), I'm lacking the necessary hardware for testing, though. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aac.c Thu May 30 00:22:07 2013 (r251116) @@ -987,14 +987,18 @@ aac_startio(struct aac_softc *sc) * busdma. */ if (cm->cm_datalen != 0) { - error = bus_dmamap_load(sc->aac_buffer_dmat, - cm->cm_datamap, cm->cm_data, - cm->cm_datalen, - aac_map_command_sg, cm, 0); + if (cm->cm_flags & AAC_REQ_BIO) + error = bus_dmamap_load_bio( + sc->aac_buffer_dmat, cm->cm_datamap, + (struct bio *)cm->cm_private, + aac_map_command_sg, cm, 0); + else + error = bus_dmamap_load(sc->aac_buffer_dmat, + cm->cm_datamap, cm->cm_data, + cm->cm_datalen, aac_map_command_sg, cm, 0); if (error == EINPROGRESS) { fwprintf(sc, HBA_FLAGS_DBG_COMM_B, "freezing queue\n"); sc->flags |= AAC_QUEUE_FRZN; - error = 0; } else if (error != 0) panic("aac_startio: unexpected error %d from " "busdma", error); @@ -1199,9 +1203,9 @@ aac_bio_command(struct aac_softc *sc, st goto fail; /* fill out the command */ - cm->cm_data = (void *)bp->bio_data; cm->cm_datalen = bp->bio_bcount; cm->cm_complete = aac_bio_complete; + cm->cm_flags = AAC_REQ_BIO; cm->cm_private = bp; cm->cm_timestamp = time_uptime; Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aac_disk.c Thu May 30 00:22:07 2013 (r251116) @@ -397,6 +397,7 @@ aac_disk_attach(device_t dev) sc->unit = device_get_unit(dev); sc->ad_disk = disk_alloc(); sc->ad_disk->d_drv1 = sc; + sc->ad_disk->d_flags = DISKFLAG_UNMAPPED_BIO; sc->ad_disk->d_name = "aacd"; sc->ad_disk->d_maxsize = sc->ad_controller->aac_max_sectors << 9; sc->ad_disk->d_open = aac_disk_open; Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Thu May 30 00:11:22 2013 (r251115) +++ head/sys/dev/aac/aacvar.h Thu May 30 00:22:07 2013 (r251116) @@ -181,6 +181,8 @@ struct aac_command #define AAC_ON_AACQ_MASK ((1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<10)) #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ +#define AAC_REQ_BIO (1 << 11) +#define AAC_REQ_CCB (1 << 12) void (*cm_complete)(struct aac_command *cm); void *cm_private; From owner-svn-src-head@FreeBSD.ORG Thu May 30 01:19:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B39C9E1; Thu, 30 May 2013 01:19:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 532CD9CF; Thu, 30 May 2013 01:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U1J3TJ038900; Thu, 30 May 2013 01:19:03 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U1J2pO038898; Thu, 30 May 2013 01:19:02 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305300119.r4U1J2pO038898@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 01:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251117 - in head/sys: dev/cfi geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 01:19:03 -0000 Author: brooks Date: Thu May 30 01:19:02 2013 New Revision: 251117 URL: http://svnweb.freebsd.org/changeset/base/251117 Log: MFP4 @222836 Add support for partitioning CFI disks from FDT using geom_flashmap. Sponsored by: DARPA, AFRL Modified: head/sys/dev/cfi/cfi_disk.c head/sys/geom/geom_flashmap.c Modified: head/sys/dev/cfi/cfi_disk.c ============================================================================== --- head/sys/dev/cfi/cfi_disk.c Thu May 30 00:22:07 2013 (r251116) +++ head/sys/dev/cfi/cfi_disk.c Thu May 30 01:19:02 2013 (r251117) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include struct cfi_disk_softc { @@ -64,6 +65,7 @@ static int cfi_disk_detach(device_t); static int cfi_disk_open(struct disk *); static int cfi_disk_close(struct disk *); static void cfi_io_proc(void *, int); +static int cfi_disk_getattr(struct bio *); static void cfi_disk_strategy(struct bio *); static int cfi_disk_ioctl(struct disk *, u_long, void *, int, struct thread *); @@ -95,6 +97,7 @@ cfi_disk_attach(device_t dev) sc->disk->d_strategy = cfi_disk_strategy; sc->disk->d_ioctl = cfi_disk_ioctl; sc->disk->d_dump = NULL; /* NB: no dumps */ + sc->disk->d_getattr = cfi_disk_getattr; sc->disk->d_sectorsize = CFI_DISK_SECSIZE; sc->disk->d_mediasize = sc->parent->sc_size; sc->disk->d_maxsize = CFI_DISK_MAXIOSIZE; @@ -275,6 +278,31 @@ cfi_io_proc(void *arg, int pending) } } +static int +cfi_disk_getattr(struct bio *bp) +{ + struct cfi_disk_softc *dsc; + struct cfi_softc *sc; + device_t dev; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) + return (ENXIO); + + dsc = bp->bio_disk->d_drv1; + sc = dsc->parent; + dev = sc->sc_dev; + + do { + if (g_handleattr(bp, "CFI::device", &dev, sizeof(device_t))) + break; + + return (ERESTART); + } while(0); + + return (EJUSTRETURN); +} + + static void cfi_disk_strategy(struct bio *bp) { Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Thu May 30 00:22:07 2013 (r251116) +++ head/sys/geom/geom_flashmap.c Thu May 30 01:19:02 2013 (r251117) @@ -186,8 +186,11 @@ g_flashmap_taste(struct g_class *mp, str do { size = sizeof(device_t); - if (g_io_getattr("NAND::device", cp, &size, &dev)) - break; + if (g_io_getattr("NAND::device", cp, &size, &dev)) { + size = sizeof(device_t); + if (g_io_getattr("CFI::device", cp, &size, &dev)) + break; + } nslices = g_flashmap_load(dev, &head); if (nslices == 0) From owner-svn-src-head@FreeBSD.ORG Thu May 30 01:22:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2421C5B; Thu, 30 May 2013 01:22:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB3BD9FF; Thu, 30 May 2013 01:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U1Movg041255; Thu, 30 May 2013 01:22:50 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U1Mo9T041253; Thu, 30 May 2013 01:22:50 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305300122.r4U1Mo9T041253@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 01:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251118 - head/sys/dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 01:22:51 -0000 Author: brooks Date: Thu May 30 01:22:50 2013 New Revision: 251118 URL: http://svnweb.freebsd.org/changeset/base/251118 Log: MFP4 @217311 Intel and Sharp flash power on with their blocks in a "locked" state. Unlocked them before attempting to perform an erase or write action and relock when the action is complete. Modified: head/sys/dev/cfi/cfi_core.c head/sys/dev/cfi/cfi_reg.h Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Thu May 30 01:19:02 2013 (r251117) +++ head/sys/dev/cfi/cfi_core.c Thu May 30 01:22:50 2013 (r251118) @@ -409,6 +409,16 @@ cfi_write_block(struct cfi_softc *sc) register_t intr; int error, i; + /* Intel flash must be unlocked before modification */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_UB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } + /* Erase the block. */ switch (sc->sc_cmdset) { case CFI_VEND_INTEL_ECS: @@ -477,6 +487,16 @@ cfi_write_block(struct cfi_softc *sc) out: cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + + /* Relock Intel flash */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } return (error); } Modified: head/sys/dev/cfi/cfi_reg.h ============================================================================== --- head/sys/dev/cfi/cfi_reg.h Thu May 30 01:19:02 2013 (r251117) +++ head/sys/dev/cfi/cfi_reg.h Thu May 30 01:22:50 2013 (r251118) @@ -105,8 +105,11 @@ struct cfi_qry { #define CFI_BCS_READ_ARRAY 0xff /* Intel commands. */ +#define CFI_INTEL_LB 0x01 /* Lock Block */ +#define CFI_INTEL_LBS 0x60 /* Lock Block Setup */ #define CFI_INTEL_READ_ID 0x90 /* Read Identifier */ #define CFI_INTEL_PP_SETUP 0xc0 /* Protection Program Setup */ +#define CFI_INTEL_UB 0xd0 /* Unlock Block */ /* NB: these are addresses for 16-bit accesses */ #define CFI_INTEL_PLR 0x80 /* Protection Lock Register */ From owner-svn-src-head@FreeBSD.ORG Thu May 30 04:46:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CF80D38; Thu, 30 May 2013 04:46:37 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA11D3B; Thu, 30 May 2013 04:46:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4kb2w012067; Thu, 30 May 2013 04:46:37 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4kbpc012062; Thu, 30 May 2013 04:46:37 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300446.r4U4kbpc012062@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251119 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 04:46:37 -0000 Author: das Date: Thu May 30 04:46:36 2013 New Revision: 251119 URL: http://svnweb.freebsd.org/changeset/base/251119 Log: Basic tests for complex inverse trig and hyperbolic functions. Added: head/tools/regression/lib/msun/test-invctrig.c (contents, props changed) Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Thu May 30 01:22:50 2013 (r251118) +++ head/tools/regression/lib/msun/Makefile Thu May 30 04:46:36 2013 (r251119) @@ -2,7 +2,8 @@ TESTS= test-cexp test-conj test-csqrt test-ctrig \ test-exponential test-fenv test-fma \ - test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ + test-fmaxmin test-ilogb test-invtrig test-invctrig \ + test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm Added: head/tools/regression/lib/msun/test-invctrig.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-invctrig.c Thu May 30 04:46:36 2013 (r251119) @@ -0,0 +1,442 @@ +/*- + * Copyright (c) 2008-2013 David Schultz + * 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. + */ + +/* + * Tests for casin[h](), cacos[h](), and catan[h](). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) +#define OPT_INVALID (ALL_STD_EXCEPT & ~FE_INVALID) +#define OPT_INEXACT (ALL_STD_EXCEPT & ~FE_INEXACT) +#define FLT_ULP() ldexpl(1.0, 1 - FLT_MANT_DIG) +#define DBL_ULP() ldexpl(1.0, 1 - DBL_MANT_DIG) +#define LDBL_ULP() ldexpl(1.0, 1 - LDBL_MANT_DIG) + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* Flags that determine whether to check the signs of the result. */ +#define CS_REAL 1 +#define CS_IMAG 2 +#define CS_BOTH (CS_REAL | CS_IMAG) + +#ifdef DEBUG +#define debug(...) printf(__VA_ARGS__) +#else +#define debug(...) (void)0 +#endif + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal((func)(_d), (result), (checksign))); \ + assert(((func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* + * Test within a given tolerance. The tolerance indicates relative error + * in ulps. + */ +#define test_p_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(cfpequal_tol((func)(_d), (result), (tol))); \ +} while (0) + +/* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + test_p(func, z, result, exceptmask, excepts, checksign); \ + test_p(func, conjl(z), conjl(result), exceptmask, excepts, checksign); \ +} while (0) +#define test_tol(func, z, result, tol) do { \ + test_p_tol(func, z, result, tol); \ + test_p_tol(func, conjl(z), conjl(result), tol); \ +} while (0) + +/* Test the given function in all precisions. */ +#define testall(func, x, result, exceptmask, excepts, checksign) do { \ + test(func, x, result, exceptmask, excepts, checksign); \ + test(func##f, x, result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_odd(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -(x), -result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_even(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -(x), result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test the given function in all precisions, within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(func, x, result, tol) do { \ + test_tol(func, x, result, (tol) * DBL_ULP()); \ + test_tol(func##f, x, result, (tol) * FLT_ULP()); \ +} while (0) +#define testall_odd_tol(func, x, result, tol) do { \ + testall_tol(func, x, result, tol); \ + testall_tol(func, -(x), -result, tol); \ +} while (0) +#define testall_even_tol(func, x, result, tol) do { \ + testall_tol(func, x, result, tol); \ + testall_tol(func, -(x), result, tol); \ +} while (0) + +static const long double +pi = 3.14159265358979323846264338327950280L, +c3pi = 9.42477796076937971538793014983850839L; + +/* + * Determine whether x and y are equal, with two special rules: + * +0.0 != -0.0 + * NaN == NaN + * If checksign is 0, we compare the absolute values instead. + */ +static int +fpequal(long double x, long double y, int checksign) +{ + if (isnan(x) && isnan(y)) + return (1); + if (checksign) + return (x == y && !signbit(x) == !signbit(y)); + else + return (fabsl(x) == fabsl(y)); +} + +static int +fpequal_tol(long double x, long double y, long double tol) +{ + fenv_t env; + int ret; + + if (isnan(x) && isnan(y)) + return (1); + if (!signbit(x) != !signbit(y)) + return (0); + if (x == y) + return (1); + if (tol == 0 || y == 0.0) + return (0); + + /* Hard case: need to check the tolerance. */ + feholdexcept(&env); + ret = fabsl(x - y) <= fabsl(y * tol); + fesetenv(&env); + return (ret); +} + +static int +cfpequal(long double complex x, long double complex y, int checksign) +{ + return (fpequal(creal(x), creal(y), checksign & CS_REAL) + && fpequal(cimag(x), cimag(y), checksign & CS_IMAG)); +} + +static int +cfpequal_tol(long double complex x, long double complex y, long double tol) +{ + return (fpequal_tol(creal(x), creal(y), tol) + && fpequal_tol(cimag(x), cimag(y), tol)); +} + + +/* Tests for 0 */ +void +test_zero(void) +{ + long double complex zero = CMPLXL(0.0, 0.0); + + testall_tol(cacosh, zero, CMPLXL(0.0, pi / 2), 1); + testall_tol(cacosh, -zero, CMPLXL(0.0, -pi / 2), 1); + testall_tol(cacos, zero, CMPLXL(pi / 2, -0.0), 1); + testall_tol(cacos, -zero, CMPLXL(pi / 2, 0.0), 1); + + testall_odd(casinh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(casin, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + + testall_odd(catanh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(catan, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); +} + +/* + * Tests for NaN inputs. + */ +void +test_nan() +{ + long double complex nan_nan = CMPLXL(NAN, NAN); + long double complex z; + + /* + * IN CACOSH CACOS CASINH CATANH + * NaN,NaN NaN,NaN NaN,NaN NaN,NaN NaN,NaN + * finite,NaN NaN,NaN* NaN,NaN* NaN,NaN* NaN,NaN* + * NaN,finite NaN,NaN* NaN,NaN* NaN,NaN* NaN,NaN* + * NaN,Inf Inf,NaN NaN,-Inf ?Inf,NaN ?0,pi/2 + * +-Inf,NaN Inf,NaN NaN,?Inf +-Inf,NaN +-0,NaN + * +-0,NaN NaN,NaN* pi/2,NaN NaN,NaN* +-0,NaN + * NaN,0 NaN,NaN* NaN,NaN* NaN,0 NaN,NaN* + * + * * = raise invalid + */ + z = nan_nan; + testall(cacosh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(cacos, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(casinh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(casin, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(catanh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall(catan, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + + z = CMPLXL(0.5, NAN); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, 0); + testall(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 0.5); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, 0); + testall(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, INFINITY); + testall(cacosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall(cacosh, -z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall(cacos, z, CMPLXL(NAN, -INFINITY), ALL_STD_EXCEPT, 0, CS_IMAG); + testall(casinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, 0); + testall(casin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_tol(catanh, z, CMPLXL(0.0, pi / 2), 1); + testall(catan, z, CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, CS_IMAG); + + z = CMPLXL(INFINITY, NAN); + testall_even(cacosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_even(cacos, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_odd(casinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_odd(casin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_odd(catanh, z, CMPLXL(0.0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0.0), 1); + + z = CMPLXL(0.0, NAN); + /* XXX We allow a spurious inexact exception here. */ + testall_even(cacosh, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + testall_even_tol(cacos, z, CMPLXL(pi / 2, NAN), 1); + testall_odd(casinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(casin, z, CMPLXL(0.0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(catanh, z, CMPLXL(0.0, NAN), OPT_INVALID, 0, CS_REAL); + testall_odd(catan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 0.0); + testall(cacosh, z, nan_nan, OPT_INVALID, 0, 0); + testall(cacos, z, nan_nan, OPT_INVALID, 0, 0); + testall(casinh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall(casin, z, nan_nan, OPT_INVALID, 0, 0); + testall(catanh, z, nan_nan, OPT_INVALID, 0, CS_IMAG); + testall(catan, z, CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, 0); +} + +void +test_inf(void) +{ + long double complex z; + + /* + * IN CACOSH CACOS CASINH CATANH + * Inf,Inf Inf,pi/4 pi/4,-Inf Inf,pi/4 0,pi/2 + * -Inf,Inf Inf,3pi/4 3pi/4,-Inf --- --- + * Inf,finite Inf,0 0,-Inf Inf,0 0,pi/2 + * -Inf,finite Inf,pi pi,-Inf --- --- + * finite,Inf Inf,pi/2 pi/2,-Inf Inf,pi/2 0,pi/2 + */ + z = CMPLXL(INFINITY, INFINITY); + testall_tol(cacosh, z, CMPLXL(INFINITY, pi / 4), 1); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -c3pi / 4), 1); + testall_tol(cacos, z, CMPLXL(pi / 4, -INFINITY), 1); + testall_tol(cacos, -z, CMPLXL(c3pi / 4, INFINITY), 1); + testall_odd_tol(casinh, z, CMPLXL(INFINITY, pi / 4), 1); + testall_odd_tol(casin, z, CMPLXL(pi / 4, INFINITY), 1); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); + + z = CMPLXL(INFINITY, 0.5); + /* XXX We allow a spurious inexact exception here. */ + testall(cacosh, z, CMPLXL(INFINITY, 0), OPT_INEXACT, 0, CS_BOTH); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -pi), 1); + testall(cacos, z, CMPLXL(0, -INFINITY), OPT_INEXACT, 0, CS_BOTH); + testall_tol(cacos, -z, CMPLXL(pi, INFINITY), 1); + testall_odd(casinh, z, CMPLXL(INFINITY, 0), OPT_INEXACT, 0, CS_BOTH); + testall_odd_tol(casin, z, CMPLXL(pi / 2, INFINITY), 1); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); + + z = CMPLXL(0.5, INFINITY); + testall_tol(cacosh, z, CMPLXL(INFINITY, pi / 2), 1); + testall_tol(cacosh, -z, CMPLXL(INFINITY, -pi / 2), 1); + testall_tol(cacos, z, CMPLXL(pi / 2, -INFINITY), 1); + testall_tol(cacos, -z, CMPLXL(pi / 2, INFINITY), 1); + testall_odd_tol(casinh, z, CMPLXL(INFINITY, pi / 2), 1); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(casin, z, CMPLXL(0.0, INFINITY), OPT_INEXACT, 0, CS_BOTH); + testall_odd_tol(catanh, z, CMPLXL(0, pi / 2), 1); + testall_odd_tol(catan, z, CMPLXL(pi / 2, 0), 1); +} + +/* Tests along the real and imaginary axes. */ +void +test_axes(void) +{ + static const long double nums[] = { + -2, -1, -0.5, 0.5, 1, 2 + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { + /* Real axis */ + z = CMPLXL(nums[i], 0.0); + if (fabs(nums[i]) <= 1) { + testall_tol(cacosh, z, CMPLXL(0.0, acos(nums[i])), 1); + testall_tol(cacos, z, CMPLXL(acosl(nums[i]), -0.0), 1); + testall_tol(casin, z, CMPLXL(asinl(nums[i]), 0.0), 1); + testall_tol(catanh, z, CMPLXL(atanh(nums[i]), 0.0), 1); + } else { + testall_tol(cacosh, z, + CMPLXL(acosh(fabs(nums[i])), + (nums[i] < 0) ? pi : 0), 1); + testall_tol(cacos, z, + CMPLXL((nums[i] < 0) ? pi : 0, + -acosh(fabs(nums[i]))), 1); + testall_tol(casin, z, + CMPLXL(copysign(pi / 2, nums[i]), + acosh(fabs(nums[i]))), 1); + testall_tol(catanh, z, + CMPLXL(atanh(1 / nums[i]), pi / 2), 1); + } + testall_tol(casinh, z, CMPLXL(asinh(nums[i]), 0.0), 1); + testall_tol(catan, z, CMPLXL(atan(nums[i]), 0), 1); + + /* TODO: Test the imaginary axis. */ + } +} + +void +test_small(void) +{ + /* + * z = 0.75 + i 0.25 + * acos(z) = Pi/4 - i ln(2)/2 + * asin(z) = Pi/4 + i ln(2)/2 + * atan(z) = atan(4)/2 + i ln(17/9)/4 + */ + static const struct { + complex long double z; + complex long double acos_z; + complex long double asin_z; + complex long double atan_z; + } tests[] = { + { CMPLXL(0.75L, 0.25L), + CMPLXL(pi / 4, -0.34657359027997265470861606072908828L), + CMPLXL(pi / 4, 0.34657359027997265470861606072908828L), + CMPLXL(0.66290883183401623252961960521423782L, + 0.15899719167999917436476103600701878L) }, + }; + int i; + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + testall_tol(cacos, tests[i].z, tests[i].acos_z, 2); + testall_odd_tol(casin, tests[i].z, tests[i].asin_z, 2); + testall_odd_tol(catan, tests[i].z, tests[i].atan_z, 2); + } +} + +/* Test inputs that might cause overflow in a sloppy implementation. */ +void +test_large(void) +{ + + /* TODO: Write these tests */ +} + +int +main(int argc, char *argv[]) +{ + + printf("1..6\n"); + + test_zero(); + printf("ok 1 - invctrig zero\n"); + + test_nan(); + printf("ok 2 - invctrig nan\n"); + + test_inf(); + printf("ok 3 - invctrig inf\n"); + + test_axes(); + printf("ok 4 - invctrig axes\n"); + + test_small(); + printf("ok 5 - invctrig small\n"); + + test_large(); + printf("ok 6 - invctrig large\n"); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Thu May 30 04:47:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0978EAF; Thu, 30 May 2013 04:47:03 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2664D4B; Thu, 30 May 2013 04:47:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4l3bp012188; Thu, 30 May 2013 04:47:03 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4l33c012187; Thu, 30 May 2013 04:47:03 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300447.r4U4l33c012187@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251120 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 04:47:03 -0000 Author: das Date: Thu May 30 04:47:03 2013 New Revision: 251120 URL: http://svnweb.freebsd.org/changeset/base/251120 Log: Fix some harmless bugs in a test. Modified: head/tools/regression/lib/msun/test-rem.c Modified: head/tools/regression/lib/msun/test-rem.c ============================================================================== --- head/tools/regression/lib/msun/test-rem.c Thu May 30 04:46:36 2013 (r251119) +++ head/tools/regression/lib/msun/test-rem.c Thu May 30 04:47:03 2013 (r251120) @@ -67,8 +67,8 @@ main(int argc, char *argv[]) test(4, 4, 0, 1); test(0, 3.0, 0, 0); - testd(0x1p-1074, 1, 0x1p-1074, 0x1p-1074); - testf(0x1p-149, 1, 0x1p-149, 0x1p-149); + testd(0x1p-1074, 1, 0x1p-1074, 0); + testf(0x1p-149, 1, 0x1p-149, 0); test(3.0, 4, -1, 1); test(3.0, -4, -1, -1); testd(275 * 1193040, 275, 0, 1193040); From owner-svn-src-head@FreeBSD.ORG Thu May 30 04:49:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 058CFFF; Thu, 30 May 2013 04:49:29 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB45DD65; Thu, 30 May 2013 04:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U4nSGS012635; Thu, 30 May 2013 04:49:28 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U4nRqM012625; Thu, 30 May 2013 04:49:27 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201305300449.r4U4nRqM012625@svn.freebsd.org> From: David Schultz Date: Thu, 30 May 2013 04:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251121 - in head: include lib/msun lib/msun/man lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 04:49:29 -0000 Author: das Date: Thu May 30 04:49:26 2013 New Revision: 251121 URL: http://svnweb.freebsd.org/changeset/base/251121 Log: I'm happy to finally commit stephen@'s implementations of cacos, cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde Added: head/lib/msun/man/cacos.3 (contents, props changed) head/lib/msun/src/catrig.c (contents, props changed) head/lib/msun/src/catrigf.c (contents, props changed) Modified: head/include/complex.h head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/ccos.3 head/lib/msun/man/ccosh.3 head/lib/msun/man/complex.3 Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Thu May 30 04:47:03 2013 (r251120) +++ head/include/complex.h Thu May 30 04:49:26 2013 (r251121) @@ -63,9 +63,21 @@ __BEGIN_DECLS double cabs(double complex); float cabsf(float complex); long double cabsl(long double complex); +double complex cacos(double complex); +float complex cacosf(float complex); +double complex cacosh(double complex); +float complex cacoshf(float complex); double carg(double complex); float cargf(float complex); long double cargl(long double complex); +double complex casin(double complex); +float complex casinf(float complex); +double complex casinh(double complex); +float complex casinhf(float complex); +double complex catan(double complex); +float complex catanf(float complex); +double complex catanh(double complex); +float complex catanhf(float complex); double complex ccos(double complex); float complex ccosf(float complex); double complex ccosh(double complex); Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/Makefile Thu May 30 04:49:26 2013 (r251121) @@ -105,7 +105,8 @@ COMMON_SRCS+= e_acosl.c e_asinl.c e_atan .endif # C99 complex functions -COMMON_SRCS+= s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ +COMMON_SRCS+= catrig.c catrigf.c \ + s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ s_cimag.c s_cimagf.c s_cimagl.c \ s_conj.c s_conjf.c s_conjl.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ @@ -126,7 +127,7 @@ SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ - ceil.3 ccos.3 ccosh.3 cexp.3 \ + ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 \ cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ @@ -144,6 +145,9 @@ MLINKS+=atan.3 atanf.3 atan.3 atanl.3 MLINKS+=atanh.3 atanhf.3 MLINKS+=atan2.3 atan2f.3 atan2.3 atan2l.3 \ atan2.3 carg.3 atan2.3 cargf.3 atan2.3 cargl.3 +MLINKS+=cacos.3 cacosf.3 cacos.3 cacosh.3 cacos.3 cacoshf.3 \ + cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinh.3 cacos.3 casinhf.3 \ + cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanh.3 cacos.3 catanhf.3 MLINKS+=ccos.3 ccosf.3 ccos.3 csin.3 ccos.3 csinf.3 ccos.3 ctan.3 ccos.3 ctanf.3 MLINKS+=ccosh.3 ccoshf.3 ccosh.3 csinh.3 ccosh.3 csinhf.3 \ ccosh.3 ctanh.3 ccosh.3 ctanhf.3 Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/Symbol.map Thu May 30 04:49:26 2013 (r251121) @@ -237,6 +237,18 @@ FBSD_1.3 { fegetround; fesetround; fesetenv; + cacos; + cacosf; + cacosh; + cacoshf; + casin; + casinf; + casinh; + casinhf; + catan; + catanf; + catanh; + catanhf; csin; csinf; csinh; Added: head/lib/msun/man/cacos.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/man/cacos.3 Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,128 @@ +.\" Copyright (c) 2013 David Schultz +.\" 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$ +.\" +.Dd May 27, 2013 +.Dt CACOS 3 +.Os +.Sh NAME +.Nm cacos , +.Nm cacosf , +.Nm cacosh , +.Nm cacoshf , +.Nm casin , +.Nm casinf +.Nm casinh , +.Nm casinhf +.Nm catan , +.Nm catanf +.Nm catanh , +.Nm catanhf +.Nd complex arc trigonometric and hyperbolic functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn cacos "double complex z" +.Ft float complex +.Fn cacosf "float complex z" +.Ft double complex +.Fn cacosh "double complex z" +.Ft float complex +.Fn cacoshf "float complex z" +.Ft double complex +.Fn casin "double complex z" +.Ft float complex +.Fn casinf "float complex z" +.Ft double complex +.Fn casinh "double complex z" +.Ft float complex +.Fn casinhf "float complex z" +.Ft double complex +.Fn catan "double complex z" +.Ft float complex +.Fn catanf "float complex z" +.Ft double complex +.Fn catanh "double complex z" +.Ft float complex +.Fn catanhf "float complex z" +.Sh DESCRIPTION +The +.Fn cacos , +.Fn casin , +and +.Fn catan +functions compute the principal value of the inverse cosine, sine, +and tangent of the complex number +.Fa z , +respectively. +The +.Fn cacosh , +.Fn casinh , +and +.Fn catanh +functions compute the principal value of the inverse hyperbolic +cosine, sine, and tangent. +The +.Fn cacosf , +.Fn casinf , +.Fn catanf +.Fn cacoshf , +.Fn casinhf , +and +.Fn catanhf +functions perform the same operations in +.Fa float +precision. +.Pp +.ie '\*[.T]'utf8' +. ds Un \[cu] +.el +. ds Un U +. +There is no universal convention for defining the principal values of +these functions. The following table gives the branch cuts, and the +corresponding ranges for the return values, adopted by the C language. +.Bl -column ".Sy Function" ".Sy (-\*(If*I, -I) \*(Un (I, \*(If*I)" ".Sy [-\*(Pi/2*I, \*(Pi/2*I]" +.It Sy Function Ta Sy Branch Cut(s) Ta Sy Range +.It cacos Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [0, \*(Pi] +.It casin Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2, \*(Pi/2] +.It catan Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2, \*(Pi/2] +.It cacosh Ta (-\*(If, 1) Ta [-\*(Pi*I, \*(Pi*I] +.It casinh Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2*I, \*(Pi/2*I] +.It catanh Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2*I, \*(Pi/2*I] +.El +.Sh SEE ALSO +.Xr ccos 3 , +.Xr ccosh 3 , +.Xr complex 3 , +.Xr cos 3 , +.Xr math 3 , +.Xr sin 3 , +.Xr tan 3 +.Sh STANDARDS +These functions conform to +.St -isoC-99 . Modified: head/lib/msun/man/ccos.3 ============================================================================== --- head/lib/msun/man/ccos.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/ccos.3 Thu May 30 04:49:26 2013 (r251121) @@ -69,6 +69,7 @@ functions perform the same operations in .Fa float precision. .Sh SEE ALSO +.Xr cacos 3 , .Xr ccosh 3 , .Xr complex 3 , .Xr cos 3 , Modified: head/lib/msun/man/ccosh.3 ============================================================================== --- head/lib/msun/man/ccosh.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/ccosh.3 Thu May 30 04:49:26 2013 (r251121) @@ -69,6 +69,7 @@ functions perform the same operations in .Fa float precision. .Sh SEE ALSO +.Xr cacosh 3 , .Xr ccos 3 , .Xr complex 3 , .Xr cosh 3 , Modified: head/lib/msun/man/complex.3 ============================================================================== --- head/lib/msun/man/complex.3 Thu May 30 04:47:03 2013 (r251120) +++ head/lib/msun/man/complex.3 Thu May 30 04:49:26 2013 (r251121) @@ -89,6 +89,12 @@ creal compute the real part .\" Section 7.3.5-6 of ISO C99 standard .Ss Trigonometric and Hyperbolic Functions .Cl +cacos arc cosine +cacosh arc hyperbolic cosine +casin arc sine +casinh arc hyperbolic sine +catan arc tangent +catanh arc hyperbolic tangent ccos cosine ccosh hyperbolic cosine csin sine @@ -111,20 +117,8 @@ The functions described here conform to .St -isoC-99 . .Sh BUGS -The inverse trigonometric and hyperbolic functions -.Fn cacos , -.Fn cacosh , -.Fn casin , -.Fn casinh , -.Fn catan , -and -.Fn catanh -are not implemented. -.Pp The logarithmic functions .Fn clog -are not implemented. -.Pp -The power functions +and the power functions .Fn cpow are not implemented. Added: head/lib/msun/src/catrig.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/catrig.c Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,643 @@ +/*- + * Copyright (c) 2012 Stephen Montgomery-Smith + * 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 "math.h" +#include "math_private.h" + +#undef isinf +#define isinf(x) (fabs(x) == INFINITY) +#undef isnan +#define isnan(x) ((x) != (x)) +#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0) +#undef signbit +#define signbit(x) (__builtin_signbit(x)) + +/* We need that DBL_EPSILON^2/128 is larger than FOUR_SQRT_MIN. */ +static const double +A_crossover = 10, /* Hull et al suggest 1.5, but 10 works better */ +B_crossover = 0.6417, /* suggested by Hull et al */ +FOUR_SQRT_MIN = 0x1p-509, /* >= 4 * sqrt(DBL_MIN) */ +QUARTER_SQRT_MAX = 0x1p509, /* <= sqrt(DBL_MAX) / 4 */ +m_e = 2.7182818284590452e0, /* 0x15bf0a8b145769.0p-51 */ +m_ln2 = 6.9314718055994531e-1, /* 0x162e42fefa39ef.0p-53 */ +pio2_hi = 1.5707963267948966e0, /* 0x1921fb54442d18.0p-52 */ +RECIP_EPSILON = 1 / DBL_EPSILON, +SQRT_3_EPSILON = 2.5809568279517849e-8, /* 0x1bb67ae8584caa.0p-78 */ +SQRT_6_EPSILON = 3.6500241499888571e-8, /* 0x13988e1409212e.0p-77 */ +SQRT_MIN = 0x1p-511; /* >= sqrt(DBL_MIN) */ + +static const volatile double +pio2_lo = 6.1232339957367659e-17; /* 0x11a62633145c07.0p-106 */ +static const volatile float +tiny = 0x1p-100; + +static double complex clog_for_large_values(double complex z); + +/* + * Testing indicates that all these functions are accurate up to 4 ULP. + * The functions casin(h) and cacos(h) are about 2.5 times slower than asinh. + * The functions catan(h) are a little under 2 times slower than atanh. + * + * The code for casinh, casin, cacos, and cacosh comes first. The code is + * rather complicated, and the four functions are highly interdependent. + * + * The code for catanh and catan comes at the end. It is much simpler than + * the other functions, and the code for these can be disconnected from the + * rest of the code. + */ + +/* + * ================================ + * | casinh, casin, cacos, cacosh | + * ================================ + */ + +/* + * The algorithm is very close to that in "Implementing the complex arcsine + * and arccosine functions using exception handling" by T. E. Hull, Thomas F. + * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on + * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335, + * http://dl.acm.org/citation.cfm?id=275324. + * + * Throughout we use the convention z = x + I*y. + * + * casinh(z) = sign(x)*log(A+sqrt(A*A-1)) + I*asin(B) + * where + * A = (|z+I| + |z-I|) / 2 + * B = (|z+I| - |z-I|) / 2 = y/A + * + * These formulas become numerically unstable: + * (a) for Re(casinh(z)) when z is close to the line segment [-I, I] (that + * is, Re(casinh(z)) is close to 0); + * (b) for Im(casinh(z)) when z is close to either of the intervals + * [I, I*infinity) or (-I*infinity, -I] (that is, |Im(casinh(z))| is + * close to PI/2). + * + * These numerical problems are overcome by defining + * f(a, b) = (hypot(a, b) - b) / 2 = a*a / (hypot(a, b) + b) / 2 + * Then if A < A_crossover, we use + * log(A + sqrt(A*A-1)) = log1p((A-1) + sqrt((A-1)*(A+1))) + * A-1 = f(x, 1+y) + f(x, 1-y) + * and if B > B_crossover, we use + * asin(B) = atan2(y, sqrt(A*A - y*y)) = atan2(y, sqrt((A+y)*(A-y))) + * A-y = f(x, y+1) + f(x, y-1) + * where without loss of generality we have assumed that x and y are + * non-negative. + * + * Much of the difficulty comes because the intermediate computations may + * produce overflows or underflows. This is dealt with in the paper by Hull + * et al by using exception handling. We do this by detecting when + * computations risk underflow or overflow. The hardest part is handling the + * underflows when computing f(a, b). + * + * Note that the function f(a, b) does not appear explicitly in the paper by + * Hull et al, but the idea may be found on pages 308 and 309. Introducing the + * function f(a, b) allows us to concentrate many of the clever tricks in this + * paper into one function. + */ + +/* + * Function f(a, b, hypot_a_b) = (hypot(a, b) - b) / 2. + * Pass hypot(a, b) as the third argument. + */ +static inline double +f(double a, double b, double hypot_a_b) +{ + if (b < 0) + return ((hypot_a_b - b) / 2); + if (b == 0) + return (a / 2); + return (a * a / (hypot_a_b + b) / 2); +} + +/* + * All the hard work is contained in this function. + * x and y are assumed positive or zero, and less than RECIP_EPSILON. + * Upon return: + * rx = Re(casinh(z)) = -Im(cacos(y + I*x)). + * B_is_usable is set to 1 if the value of B is usable. + * If B_is_usable is set to 0, sqrt_A2my2 = sqrt(A*A - y*y), and new_y = y. + * If returning sqrt_A2my2 has potential to result in an underflow, it is + * rescaled, and new_y is similarly rescaled. + */ +static inline void +do_hard_work(double x, double y, double *rx, int *B_is_usable, double *B, + double *sqrt_A2my2, double *new_y) +{ + double R, S, A; /* A, B, R, and S are as in Hull et al. */ + double Am1, Amy; /* A-1, A-y. */ + + R = hypot(x, y + 1); /* |z+I| */ + S = hypot(x, y - 1); /* |z-I| */ + + /* A = (|z+I| + |z-I|) / 2 */ + A = (R + S) / 2; + /* + * Mathematically A >= 1. There is a small chance that this will not + * be so because of rounding errors. So we will make certain it is + * so. + */ + if (A < 1) + A = 1; + + if (A < A_crossover) { + /* + * Am1 = fp + fm, where fp = f(x, 1+y), and fm = f(x, 1-y). + * rx = log1p(Am1 + sqrt(Am1*(A+1))) + */ + if (y == 1 && x < DBL_EPSILON*DBL_EPSILON / 128) { + /* + * fp is of order x^2, and fm = x/2. + * A = 1 (inexactly). + */ + *rx = sqrt(x); + } else if (x >= DBL_EPSILON * fabs(y - 1)) { + /* + * Underflow will not occur because + * x >= DBL_EPSILON^2/128 >= FOUR_SQRT_MIN + */ + Am1 = f(x, 1 + y, R) + f(x, 1 - y, S); + *rx = log1p(Am1 + sqrt(Am1 * (A + 1))); + } else if (y < 1) { + /* + * fp = x*x/(1+y)/4, fm = x*x/(1-y)/4, and + * A = 1 (inexactly). + */ + *rx = x / sqrt((1 - y) * (1 + y)); + } else /* if (y > 1) */ { + /* + * A-1 = y-1 (inexactly). + */ + *rx = log1p((y - 1) + sqrt((y - 1) * (y + 1))); + } + } else { + *rx = log(A + sqrt(A * A - 1)); + } + + *new_y = y; + + if (y < FOUR_SQRT_MIN) { + /* + * Avoid a possible underflow caused by y/A. For casinh this + * would be legitimate, but will be picked up by invoking atan2 + * later on. For cacos this would not be legitimate. + */ + *B_is_usable = 0; + *sqrt_A2my2 = A * (2 / DBL_EPSILON); + *new_y = y * (2 / DBL_EPSILON); + return; + } + + /* B = (|z+I| - |z-I|) / 2 = y/A */ + *B = y / A; + *B_is_usable = 1; + + if (*B > B_crossover) { + *B_is_usable = 0; + /* + * Amy = fp + fm, where fp = f(x, y+1), and fm = f(x, y-1). + * sqrt_A2my2 = sqrt(Amy*(A+y)) + */ + if (y == 1 && x < DBL_EPSILON / 128) { + /* + * fp is of order x^2, and fm = x/2. + * A = 1 (inexactly). + */ + *sqrt_A2my2 = sqrt(x) * sqrt((A + y) / 2); + } else if (x >= DBL_EPSILON * fabs(y - 1)) { + /* + * Underflow will not occur because + * x >= DBL_EPSILON/128 >= FOUR_SQRT_MIN + * and + * x >= DBL_EPSILON^2 >= FOUR_SQRT_MIN + */ + Amy = f(x, y + 1, R) + f(x, y - 1, S); + *sqrt_A2my2 = sqrt(Amy * (A + y)); + } else if (y > 1) { + /* + * fp = x*x/(y+1)/4, fm = x*x/(y-1)/4, and + * A = y (inexactly). + * + * y < RECIP_EPSILON. So the following + * scaling should avoid any underflow problems. + */ + *sqrt_A2my2 = x * (4 / DBL_EPSILON / DBL_EPSILON) * y / + sqrt((y + 1) * (y - 1)); + *new_y = y * (4 / DBL_EPSILON / DBL_EPSILON); + } else /* if (y < 1) */ { + /* + * fm = 1-y >= DBL_EPSILON, fp is of order x^2, and + * A = 1 (inexactly). + */ + *sqrt_A2my2 = sqrt((1 - y) * (1 + y)); + } + } +} + +/* + * casinh(z) = z + O(z^3) as z -> 0 + * + * casinh(z) = sign(x)*clog(sign(x)*z) + O(1/z^2) as z -> infinity + * The above formula works for the imaginary part as well, because + * Im(casinh(z)) = sign(x)*atan2(sign(x)*y, fabs(x)) + O(y/z^3) + * as z -> infinity, uniformly in y + */ +double complex +casinh(double complex z) +{ + double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y; + int B_is_usable; + double complex w; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + + if (isnan(x) || isnan(y)) { + /* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */ + if (isinf(x)) + return (cpack(x, y + y)); + /* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */ + if (isinf(y)) + return (cpack(y, x + x)); + /* casinh(NaN + I*0) = NaN + I*0 */ + if (y == 0) + return (cpack(x + x, y)); + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + /* Bruce Evans tells me this is the way to do this: */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + /* clog...() will raise inexact unless x or y is infinite. */ + if (signbit(x) == 0) + w = clog_for_large_values(z) + m_ln2; + else + w = clog_for_large_values(-z) + m_ln2; + return (cpack(copysign(creal(w), x), copysign(cimag(w), y))); + } + + /* Avoid spuriously raising inexact for z = 0. */ + if (x == 0 && y == 0) + return (z); + + /* All remaining cases are inexact. */ + raise_inexact(); + + if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4) + return (z); + + do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y); + if (B_is_usable) + ry = asin(B); + else + ry = atan2(new_y, sqrt_A2my2); + return (cpack(copysign(rx, x), copysign(ry, y))); +} + +/* + * casin(z) = reverse(casinh(reverse(z))) + * where reverse(x + I*y) = y + I*x = I*conj(z). + */ +double complex +casin(double complex z) +{ + double complex w = casinh(cpack(cimag(z), creal(z))); + return (cpack(cimag(w), creal(w))); +} + +/* + * cacos(z) = PI/2 - casin(z) + * but do the computation carefully so cacos(z) is accurate when z is + * close to 1. + * + * cacos(z) = PI/2 - z + O(z^3) as z -> 0 + * + * cacos(z) = -sign(y)*I*clog(z) + O(1/z^2) as z -> infinity + * The above formula works for the real part as well, because + * Re(cacos(z)) = atan2(fabs(y), x) + O(y/z^3) + * as z -> infinity, uniformly in y + */ +double complex +cacos(double complex z) +{ + double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x; + int sx, sy; + int B_is_usable; + double complex w; + + x = creal(z); + y = cimag(z); + sx = signbit(x); + sy = signbit(y); + ax = fabs(x); + ay = fabs(y); + + if (isnan(x) || isnan(y)) { + /* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */ + if (isinf(x)) + return (cpack(y + y, -INFINITY)); + /* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */ + if (isinf(y)) + return (cpack(x + x, -y)); + /* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */ + if (x == 0) + return (cpack(pio2_hi + pio2_lo, y + y)); + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + /* clog...() will raise inexact unless x or y is infinite. */ + w = clog_for_large_values(z); + rx = fabs(cimag(w)); + ry = creal(w) + m_ln2; + if (sy == 0) + ry = -ry; + return (cpack(rx, ry)); + } + + /* Avoid spuriously raising inexact for z = 1. */ + if (x == 1 && y == 0) + return (cpack(0, -y)); + + /* All remaining cases are inexact. */ + raise_inexact(); + + if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON/4) + return (cpack(pio2_hi - (x - pio2_lo), -y)); + + do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x); + if (B_is_usable) { + if (sx==0) + rx = acos(B); + else + rx = acos(-B); + } else { + if (sx==0) + rx = atan2(sqrt_A2mx2, new_x); + else + rx = atan2(sqrt_A2mx2, -new_x); + } + if (sy == 0) + ry = -ry; + return (cpack(rx, ry)); +} + +/* + * cacosh(z) = I*cacos(z) or -I*cacos(z) + * where the sign is chosen so Re(cacosh(z)) >= 0. + */ +double complex +cacosh(double complex z) +{ + double complex w; + double rx, ry; + + w = cacos(z); + rx = creal(w); + ry = cimag(w); + /* cacosh(NaN + I*NaN) = NaN + I*NaN */ + if (isnan(rx) && isnan(ry)) + return (cpack(ry, rx)); + /* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */ + /* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */ + if (isnan(rx)) + return (cpack(fabs(ry), rx)); + /* cacosh(0 + I*NaN) = NaN + I*NaN */ + if (isnan(ry)) + return (cpack(ry, ry)); + return (cpack(fabs(ry), copysign(rx, cimag(z)))); +} + +/* + * Optimized version of clog() for |z| finite and larger than ~RECIP_EPSILON. + */ +static double complex +clog_for_large_values(double complex z) +{ + double x, y; + double ax, ay, t; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + /* + * Avoid overflow in hypot() when x and y are both very large. + * Divide x and y by E, and then add 1 to the logarithm. This depends + * on E being larger than sqrt(2). + * Dividing by E causes an insignificant loss of accuracy; however + * this method is still poor since it is uneccessarily slow. + */ + if (ax > DBL_MAX / 2) + return (cpack(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x))); + + /* + * Avoid overflow when x or y is large. Avoid underflow when x or + * y is small. + */ + if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN) + return (cpack(log(hypot(x, y)), atan2(y, x))); + + return (cpack(log(ax * ax + ay * ay) / 2, atan2(y, x))); +} + +/* + *============================================================================= + */ + +/* + * ================= + * | catanh, catan | + * ================= + */ + +/* + * sum_squares(x,y) = x*x + y*y (or just x*x if y*y would underflow). + * Assumes x*x and y*y will not overflow. + * Assumes x and y are finite. + * Assumes y is non-negative. + * Assumes fabs(x) >= DBL_EPSILON. + */ +static inline double +sum_squares(double x, double y) +{ + + /* Avoid underflow when y is small. */ + if (y < SQRT_MIN) + return (x * x); + return (x * x + y * y); +} + +/* + * real_part_reciprocal(x, y) = Re(1/(x+I*y)) = x/(x*x + y*y). + * Assumes x and y are not NaN, and one of x and y is larger than + * RECIP_EPSILON. We avoid unwarranted underflow. It is important to not use + * the code creal(1/z), because the imaginary part may produce an unwanted + * underflow. + * This is only called in a context where inexact is always raised before + * the call, so no effort is made to avoid or force inexact. + */ +static inline double +real_part_reciprocal(double x, double y) +{ + double scale; + uint32_t hx, hy; + int32_t ix, iy; + + /* + * This code is inspired by the C99 document n1124.pdf, Section G.5.1, + * example 2. + */ + GET_HIGH_WORD(hx, x); + ix = hx & 0x7ff00000; + GET_HIGH_WORD(hy, y); + iy = hy & 0x7ff00000; +#define BIAS (DBL_MAX_EXP - 1) +/* XXX more guard digits are useful iff there is extra precision. */ +#define CUTOFF (DBL_MANT_DIG / 2 + 1) /* just half or 1 guard digit */ + if (ix - iy >= CUTOFF << 20 || isinf(x)) + return (1 / x); /* +-Inf -> +-0 is special */ + if (iy - ix >= CUTOFF << 20) + return (x / y / y); /* should avoid double div, but hard */ + if (ix <= (BIAS + DBL_MAX_EXP / 2 - CUTOFF) << 20) + return (x / (x * x + y * y)); + scale = 1; + SET_HIGH_WORD(scale, 0x7ff00000 - ix); /* 2**(1-ilogb(x)) */ + x *= scale; + y *= scale; + return (x / (x * x + y * y) * scale); +} + +/* + * catanh(z) = log((1+z)/(1-z)) / 2 + * = log1p(4*x / |z-1|^2) / 4 + * + I * atan2(2*y, (1-x)*(1+x)-y*y) / 2 + * + * catanh(z) = z + O(z^3) as z -> 0 + * + * catanh(z) = 1/z + sign(y)*I*PI/2 + O(1/z^3) as z -> infinity + * The above formula works for the real part as well, because + * Re(catanh(z)) = x/|z|^2 + O(x/z^4) + * as z -> infinity, uniformly in x + */ +double complex +catanh(double complex z) +{ + double x, y, ax, ay, rx, ry; + + x = creal(z); + y = cimag(z); + ax = fabs(x); + ay = fabs(y); + + /* This helps handle many cases. */ + if (y == 0 && ax <= 1) + return (cpack(atanh(x), y)); + + /* To ensure the same accuracy as atan(), and to filter out z = 0. */ + if (x == 0) + return (cpack(x, atan(y))); + + if (isnan(x) || isnan(y)) { + /* catanh(+-Inf + I*NaN) = +-0 + I*NaN */ + if (isinf(x)) + return (cpack(copysign(0, x), y + y)); + /* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */ + if (isinf(y)) { + return (cpack(copysign(0, x), + copysign(pio2_hi + pio2_lo, y))); + } + /* + * All other cases involving NaN return NaN + I*NaN. + * C99 leaves it optional whether to raise invalid if one of + * the arguments is not NaN, so we opt not to raise it. + */ + return (cpack(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + } + + if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { + return (cpack(real_part_reciprocal(x, y), + copysign(pio2_hi + pio2_lo, y))); + } + + if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { + /* + * z = 0 was filtered out above. All other cases must raise + * inexact, but this is the only only that needs to do it + * explicitly. + */ + raise_inexact(); + return (z); + } + + if (ax == 1 && ay < DBL_EPSILON) + rx = (log(ay) - m_ln2) / -2; + else + rx = log1p(4 * ax / sum_squares(ax - 1, ay)) / 4; + + if (ax == 1) + ry = atan2(2, -ay) / 2; + else if (ay < DBL_EPSILON) + ry = atan2(2 * ay, (1 - ax) * (1 + ax)) / 2; + else + ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; + + return (cpack(copysign(rx, x), copysign(ry, y))); +} + +/* + * catan(z) = reverse(catanh(reverse(z))) + * where reverse(x + I*y) = y + I*x = I*conj(z). + */ +double complex +catan(double complex z) +{ + double complex w = catanh(cpack(cimag(z), creal(z))); + return (cpack(cimag(w), creal(w))); +} Added: head/lib/msun/src/catrigf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/catrigf.c Thu May 30 04:49:26 2013 (r251121) @@ -0,0 +1,388 @@ +/*- + * Copyright (c) 2012 Stephen Montgomery-Smith + * 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. + */ + +/* + * The algorithm is very close to that in "Implementing the complex arcsine + * and arccosine functions using exception handling" by T. E. Hull, Thomas F. + * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on + * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335, + * http://dl.acm.org/citation.cfm?id=275324. + * + * The code for catrig.c contains complete comments. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "math.h" +#include "math_private.h" + +#undef isinf +#define isinf(x) (fabsf(x) == INFINITY) +#undef isnan +#define isnan(x) ((x) != (x)) +#define raise_inexact() do { volatile float junk = 1 + tiny; } while(0) +#undef signbit +#define signbit(x) (__builtin_signbitf(x)) + +static const float +A_crossover = 10, +B_crossover = 0.6417, +FOUR_SQRT_MIN = 0x1p-61, +QUARTER_SQRT_MAX = 0x1p61, +m_e = 2.7182818285e0, /* 0xadf854.0p-22 */ +m_ln2 = 6.9314718056e-1, /* 0xb17218.0p-24 */ +pio2_hi = 1.5707962513e0, /* 0xc90fda.0p-23 */ +RECIP_EPSILON = 1 / FLT_EPSILON, +SQRT_3_EPSILON = 5.9801995673e-4, /* 0x9cc471.0p-34 */ +SQRT_6_EPSILON = 8.4572793338e-4, /* 0xddb3d7.0p-34 */ +SQRT_MIN = 0x1p-63; + +static const volatile float +pio2_lo = 7.5497899549e-8, /* 0xa22169.0p-47 */ +tiny = 0x1p-100; + +static float complex clog_for_large_values(float complex z); + +static inline float +f(float a, float b, float hypot_a_b) +{ + if (b < 0) + return ((hypot_a_b - b) / 2); + if (b == 0) + return (a / 2); + return (a * a / (hypot_a_b + b) / 2); +} + +static inline void +do_hard_work(float x, float y, float *rx, int *B_is_usable, float *B, + float *sqrt_A2my2, float *new_y) +{ + float R, S, A; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 30 05:34:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B01BCFD; Thu, 30 May 2013 05:34:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 039F9F9B; Thu, 30 May 2013 05:34:29 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id EF480CA0; Thu, 30 May 2013 07:30:14 +0200 (CEST) Date: Thu, 30 May 2013 07:34:28 +0200 From: Pawel Jakub Dawidek To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r251088 - head/crypto/openssh Message-ID: <20130530053427.GA1384@garage.freebsd.pl> References: <201305290019.r4T0JxLE011755@svn.freebsd.org> <20130529070952.GA1400@garage.freebsd.pl> <86zjve3qv2.fsf@nine.des.no> <20130529125052.GA1383@garage.freebsd.pl> <867gih4ymu.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <867gih4ymu.fsf@nine.des.no> X-OS: 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, bdrewery@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 05:34:30 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 05:03:05PM +0200, Dag-Erling Sm=F8rgrav wrote: > Pawel Jakub Dawidek writes: > > AES-NI doesn't have to go through kernel at all and doing so is much > > slower. Not sure if our OpenSSL version already has native AES-NI > > support. If not it would be best to upgrade it. This would fix AES-NI > > at least. Other crypto HW that do need kernel driver would still need > > something here. I wonder if CRIOGET can't be done before setting rlimit. >=20 > The CRIOGET ioctl call happens deep inside OpenSSL. There may be a way > to pre-initialize the AES engine, but the unprivileged child doesn't > know which engine to use until after it's sandboxed. BTW. At least OpenSSL in HEAD already supports AES-NI natively. > > How does it work on OpenBSD then? >=20 > IIUC, they have sandboxing facilities in the base system and use those > instead of the extremely rudimentary rlimit-based implementation that we > use. They use systrace and from what I see they don't allow ioctl(2) in systrace policy. No idea then how they talk to the kernel crypto framework. > > > > Also what is the exact difference between "sandbox" and "yes" setti= ngs? > > > "sandbox" enables sandboxing (no surprise) which in FreeBSD's case me= ans > > > a bunch of rlimit settings. > > I thought that simple "yes" setting does chroot to /var/empty, drops > > privileges to sshd user/group and sets rlimit? I'm trying to figure out > > the difference between those two settings. >=20 > In our case, the only difference is that "sandbox" uses setrlimit() to > prevent the unprivileged child from forking, opening files or appending > to open files. I see. > > > > The reason I ask is because I plan to experiment with OpenSSH > > > > sandboxing to use Capsicum and Casper. > > > You still have the patches I sent you? > > Probably somewhere in my INBOX. If you have them handy can you please > > resend them? >=20 > Attached. Thanks! If we want to protect against compromised child allocating too much resources, we could still leave rlimit to deny fork(2) and creating new descriptors. In capability sandbox one can still allocate descriptors using dup(2), socket(2), socketpair(2), etc. Capability mode doesn't protect against DoS. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGm5OMACgkQForvXbEpPzREIgCgjiwogJwqrrfB0B647PGTZYGF y9sAoLvBYaFaB+i6A62dYcvYA8XH+YGV =HMMI -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From owner-svn-src-head@FreeBSD.ORG Thu May 30 06:20:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01F6F5A5; Thu, 30 May 2013 06:20:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E9898181; Thu, 30 May 2013 06:20:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6KNkv044180; Thu, 30 May 2013 06:20:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6KNwP044178; Thu, 30 May 2013 06:20:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305300620.r4U6KNwP044178@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 May 2013 06:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251123 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 06:20:24 -0000 Author: ed Date: Thu May 30 06:20:23 2013 New Revision: 251123 URL: http://svnweb.freebsd.org/changeset/base/251123 Log: Use #ifdef instead of #if defined. This makes these tests a bit more consistent with the tests done at the bottom of the file. Modified: head/lib/libcompiler_rt/__sync_fetch_and_op_n.h head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Modified: head/lib/libcompiler_rt/__sync_fetch_and_op_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Thu May 30 05:27:36 2013 (r251122) +++ head/lib/libcompiler_rt/__sync_fetch_and_op_n.h Thu May 30 06:20:23 2013 (r251123) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined __clang__ +#ifdef __clang__ static TYPE atomic_func(volatile TYPE *ptr, TYPE value, ...) #else Modified: head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h ============================================================================== --- head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Thu May 30 05:27:36 2013 (r251122) +++ head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Thu May 30 06:20:23 2013 (r251123) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined __clang__ +#ifdef __clang__ static TYPE atomic_func(volatile TYPE *ptr, TYPE oldval, TYPE newval, ...) #else From owner-svn-src-head@FreeBSD.ORG Thu May 30 06:20:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FB067D0; Thu, 30 May 2013 06:20:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A98C18E; Thu, 30 May 2013 06:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U6KouE045699; Thu, 30 May 2013 06:20:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U6Ko74045697; Thu, 30 May 2013 06:20:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305300620.r4U6Ko74045697@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 May 2013 06:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251124 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 06:20:51 -0000 Author: ed Date: Thu May 30 06:20:50 2013 New Revision: 251124 URL: http://svnweb.freebsd.org/changeset/base/251124 Log: Add __sync_synchronize(). This function can easily be implemented on top of the mb() macro provided by . Added: head/lib/libcompiler_rt/__sync_synchronize.c (contents, props changed) Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Thu May 30 06:20:23 2013 (r251123) +++ head/lib/libcompiler_rt/Makefile Thu May 30 06:20:50 2013 (r251124) @@ -164,6 +164,7 @@ SRCF+= __sync_fetch_and_add_4 \ __sync_fetch_and_sub_4 \ __sync_fetch_and_xor_4 \ __sync_lock_test_and_set_4 \ + __sync_synchronize \ __sync_val_compare_and_swap_4 .endif .if ${MACHINE_ARCH:Mmips64*} != "" Added: head/lib/libcompiler_rt/__sync_synchronize.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcompiler_rt/__sync_synchronize.c Thu May 30 06:20:50 2013 (r251124) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * 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 + +#ifdef __clang__ +static void +atomic_func(void) +#else +void +__sync_synchronize(void) +#endif +{ + + mb(); +} + +#ifdef __clang__ +__strong_reference(atomic_func, __sync_synchronize); +#endif From owner-svn-src-head@FreeBSD.ORG Thu May 30 07:13:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5063170F; Thu, 30 May 2013 07:13:29 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (50-196-151-174-static.hfc.comcastbusiness.net [50.196.151.174]) by mx1.freebsd.org (Postfix) with ESMTP id 2D30E632; Thu, 30 May 2013 07:13:29 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.7/8.14.2) with ESMTP id r4U7DSCu091803; Thu, 30 May 2013 00:13:28 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.7/8.14.2/Submit) id r4U7DST8091802; Thu, 30 May 2013 00:13:28 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 30 May 2013 00:13:28 -0700 From: David Schultz To: Xin LI Subject: Re: svn commit: r249035 - head/lib/libc/stdlib Message-ID: <20130530071328.GA91730@zim.MIT.EDU> References: <201304022341.r32NfL8L096954@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304022341.r32NfL8L096954@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 07:13:29 -0000 On Tue, Apr 02, 2013, Xin LI wrote: > Author: delphij > Date: Tue Apr 2 23:41:20 2013 > New Revision: 249035 > URL: http://svnweb.freebsd.org/changeset/base/249035 > > Log: > Replace access to /dev/random with the kernel pseudo-random number > source sysctl(KERN_ARND) and remove the fallback code. Thanks. I wanted to do this several years ago. Incidentally, the reason I didn't is that I had some concerns about sysctl(KERN_ARND) not being sufficiently fail-safe. There were a couple of issues, but the main one was that if something in the kernel asked for a random number before the random device was loaded, the result was not-so-random numbers. Furthermore, since the generator was seeded at that point, it continued to give out not-so-random numbers for some time. I added the following log message in the problematic case: "random device not loaded; using insecure entropy" According to a Google search, I'm not the only person to have triggered it. (I hit it because I dynamically link most drivers, including random.ko. I'm not sure about the others.) I think your patch is good, but the kernel-side issues probably bear some investigation. From owner-svn-src-head@FreeBSD.ORG Thu May 30 08:02:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6167D34D; Thu, 30 May 2013 08:02:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52B1A8DE; Thu, 30 May 2013 08:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4U821S1080435; Thu, 30 May 2013 08:02:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4U820JE080405; Thu, 30 May 2013 08:02:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305300802.r4U820JE080405@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 08:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251129 - in head: contrib/libpcap contrib/libpcap/pcap lib/libpcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 08:02:02 -0000 Author: delphij Date: Thu May 30 08:02:00 2013 New Revision: 251129 URL: http://svnweb.freebsd.org/changeset/base/251129 Log: MFV: libpcap 1.4.0. MFC after: 4 weeks Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CREDITS head/contrib/libpcap/README head/contrib/libpcap/VERSION head/contrib/libpcap/bpf_image.c head/contrib/libpcap/config.h.in head/contrib/libpcap/configure head/contrib/libpcap/configure.in head/contrib/libpcap/fad-getad.c head/contrib/libpcap/fad-gifc.c head/contrib/libpcap/fad-glifc.c head/contrib/libpcap/fad-sita.c head/contrib/libpcap/gencode.c head/contrib/libpcap/grammar.y head/contrib/libpcap/nametoaddr.c head/contrib/libpcap/optimize.c head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-bt-linux.h head/contrib/libpcap/pcap-can-linux.c head/contrib/libpcap/pcap-can-linux.h head/contrib/libpcap/pcap-canusb-linux.c head/contrib/libpcap/pcap-canusb-linux.h head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dag.h 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-linux.c head/contrib/libpcap/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netfilter-linux.h head/contrib/libpcap/pcap-nit.c head/contrib/libpcap/pcap-null.c head/contrib/libpcap/pcap-pf.c head/contrib/libpcap/pcap-septel.c head/contrib/libpcap/pcap-septel.h head/contrib/libpcap/pcap-sita.c head/contrib/libpcap/pcap-snf.c head/contrib/libpcap/pcap-snf.h head/contrib/libpcap/pcap-snit.c head/contrib/libpcap/pcap-snoop.c head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap-usb-linux.h head/contrib/libpcap/pcap-win32.c head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap_breakloop.3pcap head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_offline_filter.3pcap head/contrib/libpcap/scanner.l head/lib/libpcap/config.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/CHANGES Thu May 30 08:02:00 2013 (r251129) @@ -1,3 +1,35 @@ +Monday March 18, 2013 guy@alum.mit.edu +Summary for 1.4.0 libpcap release + Add netfilter/nfqueue interface. + If we don't have support for IPv6 address resolution, support, + in filter expressions, what IPv6 stuff we can. + Checks added for malloc()/realloc()/etc. failures. + Fix pcap-config to include -lpthread if canusb support is + present + Try to fix "pcap_parse not defined" problems when --without-flex + and --without-bison are used when you have Flex and Bison + Fix some issues with the pcap_loop man page. + Fix pcap_getnonblock() and pcap_setnonblock() to fill in the + supplied error message buffer + Fix typo that, it appeared, would cause pcap-libdlpi.c not to + compile (perhaps systems with libdlpi also have BPF and use + that instead) + Catch attempts to call pcap_compile() on a non-activated pcap_t + Fix crash on Linux with CAN-USB support without usbfs + Fix addition of VLAN tags for Linux cooked captures + Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl, so + that the driver can report either one if it doesn't support + SIOCETHTOOL + Add DLT_INFINIBAND and DLT_SCTP + Describe "proto XXX" and "protochain XXX" in the pcap-filter man + page + Handle either directories, or symlinks to directories, that + correspond to interfaces in /sys/class/net + Fix handling of VLAN tag insertion to check, on Linux 3.x + kernels, for VLAN tag valid flag + Clean up some man pages + Support libnl3 as well as libnl1 and libnl2 on Linux + Friday March 30, 2012. mcr@sandelman.ca Summary for 1.3.0 libpcap release Handle DLT_PFSYNC in {FreeBSD, other *BSD+Mac OS X, other}. Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/CREDITS Thu May 30 08:02:00 2013 (r251129) @@ -22,6 +22,7 @@ Additional people who have contributed p Armando L. Caro Jr. Assar Westerlund Brian Ginsbach + Bill Parker Charles M. Hannum Chris G. Demetriou Chris Lightfoot @@ -59,6 +60,7 @@ Additional people who have contributed p Henri Doreau Hyung Sik Yoon Igor Khristophorov + Jakub Zawadzki Jan-Philip Velders Jason R. Thorpe Javier Achirica @@ -152,4 +154,4 @@ The original LBL crew: Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Also see: http://www.wide.ad.jp/itojun-award/ Modified: head/contrib/libpcap/README ============================================================================== --- head/contrib/libpcap/README Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/README Thu May 30 08:02:00 2013 (r251129) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 1.x.y of LIBPCAP can be retrieved with the CVS tag "libpcap_1_{x}rel{y}": cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_1_{x}rel{y} libpcap -Please submit patches against the master copy to the libpcap project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -91,15 +94,18 @@ a particular release of libpcap. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for libpcap at +requests, and feature requests may also be submitted on the GitHub issue +tracker for libpcap at - http://sourceforge.net/projects/libpcap/ + https://github.com/mcr/libpcap/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for libpcap. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/libpcap/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for libpcap. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: head/contrib/libpcap/VERSION ============================================================================== --- head/contrib/libpcap/VERSION Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/VERSION Thu May 30 08:02:00 2013 (r251129) @@ -1 +1 @@ -1.3.0 +1.4.0 Modified: head/contrib/libpcap/bpf_image.c ============================================================================== --- head/contrib/libpcap/bpf_image.c Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/bpf_image.c Thu May 30 08:02:00 2013 (r251129) @@ -292,11 +292,14 @@ bpf_image(p, n) break; } (void)snprintf(operand, sizeof operand, fmt, v); - (void)snprintf(image, sizeof image, - (BPF_CLASS(p->code) == BPF_JMP && - BPF_OP(p->code) != BPF_JA) ? - "(%03d) %-8s %-16s jt %d\tjf %d" - : "(%03d) %-8s %s", - n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + if (BPF_CLASS(p->code) == BPF_JMP && BPF_OP(p->code) != BPF_JA) { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %-16s jt %d\tjf %d", + n, op, operand, n + 1 + p->jt, n + 1 + p->jf); + } else { + (void)snprintf(image, sizeof image, + "(%03d) %-8s %s", + n, op, operand); + } return image; } Modified: head/contrib/libpcap/config.h.in ============================================================================== --- head/contrib/libpcap/config.h.in Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/config.h.in Thu May 30 08:02:00 2013 (r251129) @@ -58,6 +58,15 @@ /* if libnl exists and is version 2.x */ #undef HAVE_LIBNL_2_x +/* if libnl exists and is version 3.x */ +#undef HAVE_LIBNL_3_x + +/* libnl has NLE_FAILURE */ +#undef HAVE_LIBNL_NLE + +/* libnl has new-style socket api */ +#undef HAVE_LIBNL_SOCKETS + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -211,6 +220,9 @@ /* path for device for USB sniffing */ #undef LINUX_USB_MON_DEV +/* if we need a pcap_parse wrapper around yyparse */ +#undef NEED_YYPARSE_WRAPPER + /* Define to 1 if netinet/ether.h declares `ether_hostton' */ #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON @@ -232,9 +244,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -259,6 +268,9 @@ /* include ACN support */ #undef SITA +/* if struct sockaddr_hci has hci_channel member */ +#undef SOCKADDR_HCI_HAS_HCI_CHANNEL + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS Modified: head/contrib/libpcap/configure ============================================================================== --- head/contrib/libpcap/configure Thu May 30 06:46:52 2013 (r251128) +++ head/contrib/libpcap/configure Thu May 30 08:02:00 2013 (r251129) @@ -1,84 +1,61 @@ #! /bin/sh # From configure.in Revision: 1.168 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67. -# +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' + PATH_SEPARATOR=: fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' + rm -f conf$$.sh fi -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi @@ -87,18 +64,20 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -109,321 +88,354 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` # CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$as_unset CDPATH + if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST + if (eval ":") 2>/dev/null; then + as_have_required=yes else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac + as_have_required=no fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes +if as_func_success; then + : else - as_have_required=no + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : +if as_func_ret_success; then + : else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( + case $as_dir in /*) for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac - as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' +if as_func_ret_success; then + : else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error + exitcode=1 + echo positional parameters were not saved. +fi -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : else - as_expr=false + exitcode=1 + echo as_func_success failed. fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : else - as_basename=false + exitcode=1 + echo as_func_ret_success failed. fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : else - as_dirname=false + exitcode=1 + echo positional parameters were not saved. fi -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -440,7 +452,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -450,40 +463,49 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 30 11:08:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED559A5D; Thu, 30 May 2013 11:08:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE74E5E2; Thu, 30 May 2013 11:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UB8GZp044902; Thu, 30 May 2013 11:08:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UB8GqU044899; Thu, 30 May 2013 11:08:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301108.r4UB8GqU044899@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251130 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 11:08:17 -0000 Author: luigi Date: Thu May 30 11:08:16 2013 New Revision: 251130 URL: http://svnweb.freebsd.org/changeset/base/251130 Log: remove use of deprecated ioctl() Modified: head/tools/tools/netmap/nm_util.c head/tools/tools/netmap/pcap.c Modified: head/tools/tools/netmap/nm_util.c ============================================================================== --- head/tools/tools/netmap/nm_util.c Thu May 30 08:02:00 2013 (r251129) +++ head/tools/tools/netmap/nm_util.c Thu May 30 11:08:16 2013 (r251130) @@ -221,7 +221,6 @@ netmap_close(struct my_ring *me) D(""); if (me->mem) munmap(me->mem, me->memsize); - ioctl(me->fd, NIOCUNREGIF, NULL); close(me->fd); return (0); } Modified: head/tools/tools/netmap/pcap.c ============================================================================== --- head/tools/tools/netmap/pcap.c Thu May 30 08:02:00 2013 (r251129) +++ head/tools/tools/netmap/pcap.c Thu May 30 11:08:16 2013 (r251130) @@ -13,7 +13,7 @@ #define MY_PCAP #include "nm_util.h" -char *version = "$Id: pcap.c 11463 2012-07-30 15:26:02Z luigi $"; +char *version = "$Id$"; int verbose = 0; /* @@ -445,7 +445,6 @@ pcap_close(pcap_t *p) if (me->mem) munmap(me->mem, me->memsize); /* restore original flags ? */ - ioctl(me->fd, NIOCUNREGIF, NULL); close(me->fd); bzero(me, sizeof(*me)); free(me); From owner-svn-src-head@FreeBSD.ORG Thu May 30 11:09:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D05BBE8; Thu, 30 May 2013 11:09:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC1C35EE; Thu, 30 May 2013 11:09:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UB9fU5045232; Thu, 30 May 2013 11:09:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UB9ftS045231; Thu, 30 May 2013 11:09:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301109.r4UB9ftS045231@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251131 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 11:09:42 -0000 Author: luigi Date: Thu May 30 11:09:41 2013 New Revision: 251131 URL: http://svnweb.freebsd.org/changeset/base/251131 Log: add a compile-time option to copy packets instead of doing the buffer swapping. Modified: head/tools/tools/netmap/bridge.c Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Thu May 30 11:08:16 2013 (r251130) +++ head/tools/tools/netmap/bridge.c Thu May 30 11:09:41 2013 (r251131) @@ -14,7 +14,7 @@ int verbose = 0; -char *version = "$Id: bridge.c 12016 2013-01-23 17:24:22Z luigi $"; +char *version = "$Id$"; static int do_abort = 0; @@ -50,7 +50,12 @@ process_rings(struct netmap_ring *rxring while (limit-- > 0) { struct netmap_slot *rs = &rxring->slot[j]; struct netmap_slot *ts = &txring->slot[k]; +#ifdef NO_SWAP + char *rxbuf = NETMAP_BUF(rxring, rs->buf_idx); + char *txbuf = NETMAP_BUF(txring, ts->buf_idx); +#else uint32_t pkt; +#endif /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { @@ -58,20 +63,24 @@ process_rings(struct netmap_ring *rxring j, rs->buf_idx, k, ts->buf_idx); sleep(2); } +#ifndef NO_SWAP pkt = ts->buf_idx; ts->buf_idx = rs->buf_idx; rs->buf_idx = pkt; - +#endif /* copy the packet length. */ if (rs->len < 14 || rs->len > 2048) D("wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); else if (verbose > 1) D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); ts->len = rs->len; - +#ifdef NO_SWAP + pkt_copy(rxbuf, txbuf, ts->len); +#else /* report the buffer change. */ ts->flags |= NS_BUF_CHANGED; rs->flags |= NS_BUF_CHANGED; +#endif /* NO_SWAP */ j = NETMAP_RING_NEXT(rxring, j); k = NETMAP_RING_NEXT(txring, k); } From owner-svn-src-head@FreeBSD.ORG Thu May 30 11:10:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18716D67; Thu, 30 May 2013 11:10:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF0E05F9; Thu, 30 May 2013 11:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UBAgx4047095; Thu, 30 May 2013 11:10:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UBAgkL047094; Thu, 30 May 2013 11:10:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301110.r4UBAgkL047094@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 11:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251132 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 11:10:43 -0000 Author: luigi Date: Thu May 30 11:10:42 2013 New Revision: 251132 URL: http://svnweb.freebsd.org/changeset/base/251132 Log: add support for rate-limiting in the sender (-R ...) Obtained from: Giuseppe Lettieri Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Thu May 30 11:09:41 2013 (r251131) +++ head/tools/tools/netmap/pkt-gen.c Thu May 30 11:10:42 2013 (r251132) @@ -25,7 +25,7 @@ /* * $FreeBSD$ - * $Id: pkt-gen.c 12024 2013-01-25 05:41:51Z luigi $ + * $Id$ * * Example program to show how to build a multithreaded packet * source/sink using the netmap device. @@ -89,6 +89,9 @@ struct glob_arg { int dev_type; pcap_t *p; + int tx_rate; + struct timespec tx_period; + int affinity; int main_fd; int report_interval; @@ -114,7 +117,7 @@ struct targ { struct netmap_if *nifp; uint16_t qfirst, qlast; /* range of queues to scan */ volatile uint64_t count; - struct timeval tic, toc; + struct timespec tic, toc; int me; pthread_t thread; int affinity; @@ -669,6 +672,76 @@ ponger_body(void *data) return NULL; } +static __inline int +timespec_ge(const struct timespec *a, const struct timespec *b) +{ + + if (a->tv_sec > b->tv_sec) + return (1); + if (a->tv_sec < b->tv_sec) + return (0); + if (a->tv_nsec >= b->tv_nsec) + return (1); + return (0); +} + +static __inline struct timespec +timeval2spec(const struct timeval *a) +{ + struct timespec ts = { + .tv_sec = a->tv_sec, + .tv_nsec = a->tv_usec * 1000 + }; + return ts; +} + +static __inline struct timeval +timespec2val(const struct timespec *a) +{ + struct timeval tv = { + .tv_sec = a->tv_sec, + .tv_usec = a->tv_nsec / 1000 + }; + return tv; +} + + +static int +wait_time(struct timespec ts, struct timespec *wakeup_ts, long long *waited) +{ + struct timespec curtime; + + curtime.tv_sec = 0; + curtime.tv_nsec = 0; + + if (clock_gettime(CLOCK_REALTIME_PRECISE, &curtime) == -1) { + D("clock_gettime: %s", strerror(errno)); + return (-1); + } + while (timespec_ge(&ts, &curtime)) { + if (waited != NULL) + (*waited)++; + if (clock_gettime(CLOCK_REALTIME_PRECISE, &curtime) == -1) { + D("clock_gettime"); + return (-1); + } + } + if (wakeup_ts != NULL) + *wakeup_ts = curtime; + return (0); +} + +static __inline void +timespec_add(struct timespec *tsa, struct timespec *tsb) +{ + tsa->tv_sec += tsb->tv_sec; + tsa->tv_nsec += tsb->tv_nsec; + if (tsa->tv_nsec >= 1000000000) { + tsa->tv_sec++; + tsa->tv_nsec -= 1000000000; + } +} + static void * sender_body(void *data) @@ -680,7 +753,10 @@ sender_body(void *data) struct netmap_ring *txring; int i, n = targ->g->npackets / targ->g->nthreads, sent = 0; int options = targ->g->options | OPT_COPY; -D("start"); + struct timespec tmptime, nexttime = { 0, 0}; // XXX silence compiler + int rate_limit = targ->g->tx_rate; + long long waited = 0; + D("start"); if (setaffinity(targ->thread, targ->affinity)) goto quit; /* setup poll(2) mechanism. */ @@ -689,8 +765,18 @@ D("start"); fds[0].events = (POLLOUT); /* main loop.*/ - gettimeofday(&targ->tic, NULL); - + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->tic); + if (rate_limit) { + tmptime.tv_sec = 2; + tmptime.tv_nsec = 0; + timespec_add(&targ->tic, &tmptime); + targ->tic.tv_nsec = 0; + if (wait_time(targ->tic, NULL, NULL) == -1) { + D("wait_time: %s", strerror(errno)); + goto quit; + } + nexttime = targ->tic; + } if (targ->g->dev_type == DEV_PCAP) { int size = targ->g->pkt_size; void *pkt = &targ->pkt; @@ -718,8 +804,18 @@ D("start"); } } } else { + int tosend = 0; while (!targ->cancel && (n == 0 || sent < n)) { + if (rate_limit && tosend <= 0) { + tosend = targ->g->burst; + timespec_add(&nexttime, &targ->g->tx_period); + if (wait_time(nexttime, &tmptime, &waited) == -1) { + D("wait_time"); + goto quit; + } + } + /* * wait for available room in the send queue(s) */ @@ -737,7 +833,7 @@ D("start"); options &= ~OPT_COPY; } for (i = targ->qfirst; i < targ->qlast; i++) { - int m, limit = targ->g->burst; + int m, limit = rate_limit ? tosend : targ->g->burst; if (n > 0 && n - sent < limit) limit = n - sent; txring = NETMAP_TXRING(nifp, i); @@ -746,6 +842,7 @@ D("start"); m = send_packets(txring, &targ->pkt, targ->g->pkt_size, limit, options); sent += m; + tosend -= m; targ->count = sent; } } @@ -762,7 +859,7 @@ D("start"); } } - gettimeofday(&targ->toc, NULL); + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->toc); targ->completed = 1; targ->count = sent; @@ -834,7 +931,7 @@ receiver_body(void *data) } /* main loop, exit after 1s silence */ - gettimeofday(&targ->tic, NULL); + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->tic); if (targ->g->dev_type == DEV_PCAP) { while (!targ->cancel) { /* XXX should we poll ? */ @@ -852,8 +949,8 @@ receiver_body(void *data) while (!targ->cancel) { /* Once we started to receive packets, wait at most 1 seconds before quitting. */ - if (poll(fds, 1, 1 * 1000) <= 0 && targ->g->forever == 0) { - gettimeofday(&targ->toc, NULL); + if (poll(fds, 1, 1 * 1000) <= 0 && !targ->g->forever) { + clock_gettime(CLOCK_REALTIME_PRECISE, &targ->toc); targ->toc.tv_sec -= 1; /* Subtract timeout time. */ break; } @@ -1085,11 +1182,13 @@ main_thread(struct glob_arg *g) timerclear(&tic); timerclear(&toc); for (i = 0; i < g->nthreads; i++) { + struct timespec t_tic, t_toc; /* * Join active threads, unregister interfaces and close * file descriptors. */ - pthread_join(targs[i].thread, NULL); + if (targs[i].used) + pthread_join(targs[i].thread, NULL); close(targs[i].fd); if (targs[i].completed == 0) @@ -1100,10 +1199,12 @@ main_thread(struct glob_arg *g) * how long it took to send all the packets. */ count += targs[i].count; - if (!timerisset(&tic) || timercmp(&targs[i].tic, &tic, <)) - tic = targs[i].tic; - if (!timerisset(&toc) || timercmp(&targs[i].toc, &toc, >)) - toc = targs[i].toc; + t_tic = timeval2spec(&tic); + t_toc = timeval2spec(&toc); + if (!timerisset(&tic) || timespec_ge(&targs[i].tic, &t_tic)) + tic = timespec2val(&targs[i].tic); + if (!timerisset(&toc) || timespec_ge(&targs[i].toc, &t_toc)) + toc = timespec2val(&targs[i].toc); } /* print output. */ @@ -1115,7 +1216,6 @@ main_thread(struct glob_arg *g) rx_output(count, delta_t); if (g->dev_type == DEV_NETMAP) { - ioctl(g->main_fd, NIOCUNREGIF, NULL); // XXX deprecated munmap(g->mmap_addr, g->mmap_size); close(g->main_fd); } @@ -1224,9 +1324,10 @@ main(int arc, char **argv) g.burst = 512; // default g.nthreads = 1; g.cpus = 1; + g.tx_rate = 0; while ( (ch = getopt(arc, argv, - "a:f:n:i:t:r:l:d:s:D:S:b:c:o:p:PT:w:Wv")) != -1) { + "a:f:n:i:t:r:l:d:s:D:S:b:c:o:p:PT:w:WvR:")) != -1) { struct sf *fn; switch(ch) { @@ -1325,6 +1426,10 @@ main(int arc, char **argv) break; case 'v': verbose++; + break; + case 'R': + g.tx_rate = atoi(optarg); + break; } } @@ -1473,6 +1578,23 @@ main(int arc, char **argv) g.options & OPT_MEMCPY ? " memcpy" : "", g.options & OPT_COPY ? " copy" : ""); } + + if (g.tx_rate == 0) { + g.tx_period.tv_sec = 0; + g.tx_period.tv_nsec = 0; + } else if (g.tx_rate == 1) { + g.tx_period.tv_sec = 1; + g.tx_period.tv_nsec = 0; + } else { + g.tx_period.tv_sec = 0; + g.tx_period.tv_nsec = (1e9 / g.tx_rate) * g.burst; + if (g.tx_period.tv_nsec > 1000000000) { + g.tx_period.tv_sec = g.tx_period.tv_nsec / 1000000000; + g.tx_period.tv_nsec = g.tx_period.tv_nsec % 1000000000; + } + } + D("Sending %d packets every %d.%09d ns", + g.burst, (int)g.tx_period.tv_sec, (int)g.tx_period.tv_nsec); /* Wait for PHY reset. */ D("Wait %d secs for phy reset", wait_link); sleep(wait_link); From owner-svn-src-head@FreeBSD.ORG Thu May 30 12:16:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18CF747B; Thu, 30 May 2013 12:16:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE6B1A60; Thu, 30 May 2013 12:16:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCGt2C069557; Thu, 30 May 2013 12:16:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCGtkk069554; Thu, 30 May 2013 12:16:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301216.r4UCGtkk069554@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 12:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251133 - in head/sys/dev: msk sk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 12:16:56 -0000 Author: marius Date: Thu May 30 12:16:55 2013 New Revision: 251133 URL: http://svnweb.freebsd.org/changeset/base/251133 Log: - Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method sees the actual PCI device which makes the request for DMA tag, instead of some descendant of the PCI device, by creating a pass-through trampoline. - Sprinkle const on tables. - Use NULL instead of 0 for pointers. - Take advantage of nitems(). MFC after: 1 week Modified: head/sys/dev/msk/if_msk.c head/sys/dev/sk/if_sk.c head/sys/dev/sk/if_skreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/msk/if_msk.c Thu May 30 12:16:55 2013 (r251133) @@ -162,7 +162,7 @@ TUNABLE_INT("hw.msk.jumbo_disable", &jum /* * Devices supported by this driver. */ -static struct msk_product { +static const struct msk_product { uint16_t msk_vendorid; uint16_t msk_deviceid; const char *msk_name; @@ -257,6 +257,7 @@ static int mskc_shutdown(device_t); static int mskc_setup_rambuffer(struct msk_softc *); static int mskc_suspend(device_t); static int mskc_resume(device_t); +static bus_dma_tag_t mskc_get_dma_tag(device_t, device_t); static void mskc_reset(struct msk_softc *); static int msk_probe(device_t); @@ -334,6 +335,8 @@ static device_method_t mskc_methods[] = DEVMETHOD(device_resume, mskc_resume), DEVMETHOD(device_shutdown, mskc_shutdown), + DEVMETHOD(bus_get_dma_tag, mskc_get_dma_tag), + DEVMETHOD_END }; @@ -368,9 +371,9 @@ static driver_t msk_driver = { static devclass_t msk_devclass; -DRIVER_MODULE(mskc, pci, mskc_driver, mskc_devclass, 0, 0); -DRIVER_MODULE(msk, mskc, msk_driver, msk_devclass, 0, 0); -DRIVER_MODULE(miibus, msk, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mskc, pci, mskc_driver, mskc_devclass, NULL, NULL); +DRIVER_MODULE(msk, mskc, msk_driver, msk_devclass, NULL, NULL); +DRIVER_MODULE(miibus, msk, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec msk_res_spec_io[] = { { SYS_RES_IOPORT, PCIR_BAR(1), RF_ACTIVE }, @@ -1180,15 +1183,14 @@ msk_ioctl(struct ifnet *ifp, u_long comm static int mskc_probe(device_t dev) { - struct msk_product *mp; + const struct msk_product *mp; uint16_t vendor, devid; int i; vendor = pci_get_vendor(dev); devid = pci_get_device(dev); mp = msk_products; - for (i = 0; i < sizeof(msk_products)/sizeof(msk_products[0]); - i++, mp++) { + for (i = 0; i < nitems(msk_products); i++, mp++) { if (vendor == mp->msk_vendorid && devid == mp->msk_deviceid) { device_set_desc(dev, mp->msk_name); return (BUS_PROBE_DEFAULT); @@ -2118,6 +2120,13 @@ mskc_detach(device_t dev) return (0); } +static bus_dma_tag_t +mskc_get_dma_tag(device_t bus, device_t child __unused) +{ + + return (bus_get_dma_tag(bus)); +} + struct msk_dmamap_arg { bus_addr_t msk_busaddr; }; Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/sk/if_sk.c Thu May 30 12:16:55 2013 (r251133) @@ -143,7 +143,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif -static struct sk_type sk_devs[] = { +static const struct sk_type sk_devs[] = { { VENDORID_SK, DEVICEID_SK_V1, @@ -193,6 +193,7 @@ static int skc_detach(device_t); static int skc_shutdown(device_t); static int skc_suspend(device_t); static int skc_resume(device_t); +static bus_dma_tag_t skc_get_dma_tag(device_t, device_t); static int sk_detach(device_t); static int sk_probe(device_t); static int sk_attach(device_t); @@ -296,6 +297,8 @@ static device_method_t skc_methods[] = { DEVMETHOD(device_resume, skc_resume), DEVMETHOD(device_shutdown, skc_shutdown), + DEVMETHOD(bus_get_dma_tag, skc_get_dma_tag), + DEVMETHOD_END }; @@ -330,9 +333,9 @@ static driver_t sk_driver = { static devclass_t sk_devclass; -DRIVER_MODULE(skc, pci, skc_driver, skc_devclass, 0, 0); -DRIVER_MODULE(sk, skc, sk_driver, sk_devclass, 0, 0); -DRIVER_MODULE(miibus, sk, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(skc, pci, skc_driver, skc_devclass, NULL, NULL); +DRIVER_MODULE(sk, skc, sk_driver, sk_devclass, NULL, NULL); +DRIVER_MODULE(miibus, sk, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec sk_res_spec_io[] = { { SYS_RES_IOPORT, PCIR_BAR(1), RF_ACTIVE }, @@ -1186,7 +1189,7 @@ static int skc_probe(dev) device_t dev; { - struct sk_type *t = sk_devs; + const struct sk_type *t = sk_devs; while(t->sk_name != NULL) { if ((pci_get_vendor(dev) == t->sk_vid) && @@ -1888,6 +1891,13 @@ skc_detach(dev) return(0); } +static bus_dma_tag_t +skc_get_dma_tag(device_t bus, device_t child __unused) +{ + + return (bus_get_dma_tag(bus)); +} + struct sk_dmamap_arg { bus_addr_t sk_busaddr; }; @@ -3185,7 +3195,7 @@ sk_init_xmac(sc_if) struct sk_softc *sc; struct ifnet *ifp; u_int16_t eaddr[(ETHER_ADDR_LEN+1)/2]; - struct sk_bcom_hack bhack[] = { + static const struct sk_bcom_hack bhack[] = { { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, Modified: head/sys/dev/sk/if_skreg.h ============================================================================== --- head/sys/dev/sk/if_skreg.h Thu May 30 11:10:42 2013 (r251132) +++ head/sys/dev/sk/if_skreg.h Thu May 30 12:16:55 2013 (r251133) @@ -1289,7 +1289,7 @@ struct sk_type { u_int16_t sk_vid; u_int16_t sk_did; - char *sk_name; + const char *sk_name; }; #define SK_ADDR_LO(x) ((u_int64_t) (x) & 0xffffffff) From owner-svn-src-head@FreeBSD.ORG Thu May 30 12:18:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5045E7A6; Thu, 30 May 2013 12:18:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BD507A7B; Thu, 30 May 2013 12:18:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AB6FAB939; Thu, 30 May 2013 08:18:48 -0400 (EDT) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r251098 - head/sys/contrib/dev/ath/ath_hal/ar9300 Date: Thu, 30 May 2013 07:56:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305290421.r4T4LgRc099595@svn.freebsd.org> <51A5E4DE.5060007@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305300756.52601.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 30 May 2013 08:18:48 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 12:18:52 -0000 On Wednesday, May 29, 2013 1:58:44 pm Adrian Chadd wrote: > No, it actually failed to compile at all on some older 9-stable laptops.. > > Hence my confusion. defines the bool type in HEAD in the KERNEL: #ifdef _KERNEL ... #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus) #define __bool_true_false_are_defined 1 #define false 0 #define true 1 #if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) typedef int _Bool; #endif typedef _Bool bool; #endif /* !__bool_true_false_are_defined && !__cplusplus */ ... -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu May 30 13:41:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 191B9AF8; Thu, 30 May 2013 13:41:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8BF229; Thu, 30 May 2013 13:41:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UDfJ6R000340; Thu, 30 May 2013 13:41:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UDfJeC000339; Thu, 30 May 2013 13:41:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301341.r4UDfJeC000339@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 13:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251138 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 13:41:20 -0000 Author: luigi Date: Thu May 30 13:41:19 2013 New Revision: 251138 URL: http://svnweb.freebsd.org/changeset/base/251138 Log: clarify usage of NETMAP_BUF Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Thu May 30 13:11:56 2013 (r251137) +++ head/sys/net/netmap_user.h Thu May 30 13:41:19 2013 (r251138) @@ -51,8 +51,8 @@ * ring->slot[i] gives us the i-th slot (we can access * directly plen, flags, bufindex) * - * char *buf = NETMAP_BUF(ring, index) returns a pointer to - * the i-th buffer + * char *buf = NETMAP_BUF(ring, x) returns a pointer to + * the buffer numbered x * * Since rings are circular, we have macros to compute the next index * i = NETMAP_RING_NEXT(ring, i); From owner-svn-src-head@FreeBSD.ORG Thu May 30 14:07:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 885718B8; Thu, 30 May 2013 14:07:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3DC605; Thu, 30 May 2013 14:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UE7E4x008730; Thu, 30 May 2013 14:07:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UE7E8j008728; Thu, 30 May 2013 14:07:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305301407.r4UE7E8j008728@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 30 May 2013 14:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251139 - in head: sys/dev/netmap sys/net tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 14:07:14 -0000 Author: luigi Date: Thu May 30 14:07:14 2013 New Revision: 251139 URL: http://svnweb.freebsd.org/changeset/base/251139 Log: Bring in a number of new features, mostly implemented by Michio Honda: - the VALE switch now support up to 254 destinations per switch, unicast or broadcast (multicast goes to all ports). - we can attach hw interfaces and the host stack to a VALE switch, which means we will be able to use it more or less as a native bridge (minor tweaks still necessary). A 'vale-ctl' program is supplied in tools/tools/netmap to attach/detach ports the switch, and list current configuration. - the lookup function in the VALE switch can be reassigned to something else, similar to the pf hooks. This will enable attaching the firewall, or other processing functions (e.g. in-kernel openvswitch) directly on the netmap port. The internal API used by device drivers does not change. Userspace applications should be recompiled because we bump NETMAP_API as we now use some fields in the struct nmreq that were previously ignored -- otherwise, data structures are the same. Manpages will be committed separately. Added: head/tools/tools/netmap/vale-ctl.c (contents, props changed) Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/net/netmap.h head/tools/tools/netmap/Makefile Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu May 30 13:41:19 2013 (r251138) +++ head/sys/dev/netmap/netmap.c Thu May 30 14:07:14 2013 (r251139) @@ -119,6 +119,9 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, mitiga int netmap_no_pendintr = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +int netmap_txsync_retry = 2; +SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, + &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); int netmap_drop = 0; /* debugging */ int netmap_flags = 0; /* debug flags */ @@ -128,25 +131,30 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, drop, SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -#ifdef NM_BRIDGE /* support for netmap bridge */ +#ifdef NM_BRIDGE /* support for netmap virtual switch, called VALE */ /* - * system parameters. + * system parameters (most of them in netmap_kern.h) + * NM_NAME prefix for switch port names, default "vale" + * NM_MAXPORTS number of ports + * NM_BRIDGES max number of switches in the system. + * XXX should become a sysctl or tunable * - * All switched ports have prefix NM_NAME. - * The switch has a max of NM_BDG_MAXPORTS ports (often stored in a bitmap, - * so a practical upper bound is 64). - * Each tx ring is read-write, whereas rx rings are readonly (XXX not done yet). + * Switch ports are named valeX:Y where X is the switch name and Y + * is the port. If Y matches a physical interface name, the port is + * connected to a physical device. + * + * Unlike physical interfaces, switch ports use their own memory region + * for rings and buffers. * The virtual interfaces use per-queue lock instead of core lock. * In the tx loop, we aggregate traffic in batches to make all operations * faster. The batch size is NM_BDG_BATCH */ -#define NM_NAME "vale" /* prefix for the interface */ -#define NM_BDG_MAXPORTS 16 /* up to 64 ? */ +#define NM_BDG_MAXRINGS 16 /* XXX unclear how many. */ #define NM_BRIDGE_RINGSIZE 1024 /* in the device */ #define NM_BDG_HASH 1024 /* forwarding table entries */ #define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ -#define NM_BRIDGES 4 /* number of bridges */ +#define NM_BRIDGES 8 /* number of bridges */ int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ @@ -174,14 +182,27 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge #define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) #define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) -static void bdg_netmap_attach(struct ifnet *ifp); +static void bdg_netmap_attach(struct netmap_adapter *); static int bdg_netmap_reg(struct ifnet *ifp, int onoff); +static int kern_netmap_regif(struct nmreq *nmr); + /* per-tx-queue entry */ struct nm_bdg_fwd { /* forwarding entry for a bridge */ void *buf; - uint64_t dst; /* dst mask */ - uint32_t src; /* src index ? */ - uint16_t len; /* src len */ + uint32_t ft_dst; /* dst port */ + uint16_t ft_len; /* src len */ + uint16_t ft_next; /* next packet to same destination */ +}; + +/* We need to build a list of buffers going to each destination. + * Each buffer is in one entry of struct nm_bdg_fwd, we use ft_next + * to build the list, and struct nm_bdg_q below for the queue. + * The structure should compact because potentially we have a lot + * of destinations. + */ +struct nm_bdg_q { + uint16_t bq_head; + uint16_t bq_tail; }; struct nm_hash_ent { @@ -198,26 +219,78 @@ struct nm_hash_ent { * The bridge is non blocking on the transmit ports. * * bdg_lock protects accesses to the bdg_ports array. + * This is a rw lock (or equivalent). */ struct nm_bridge { - struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; - int n_ports; - uint64_t act_ports; - int freelist; /* first buffer index */ - NM_SELINFO_T si; /* poll/select wait queue */ - NM_LOCK_T bdg_lock; /* protect the selinfo ? */ + int namelen; /* 0 means free */ - /* the forwarding table, MAC+ports */ - struct nm_hash_ent ht[NM_BDG_HASH]; + /* XXX what is the proper alignment/layout ? */ + NM_RWLOCK_T bdg_lock; /* protects bdg_ports */ + struct netmap_adapter *bdg_ports[NM_BDG_MAXPORTS]; - int namelen; /* 0 means free */ char basename[IFNAMSIZ]; + /* + * The function to decide the destination port. + * It returns either of an index of the destination port, + * NM_BDG_BROADCAST to broadcast this packet, or NM_BDG_NOPORT not to + * forward this packet. ring_nr is the source ring index, and the + * function may overwrite this value to forward this packet to a + * different ring index. + * This function must be set by netmap_bdgctl(). + */ + bdg_lookup_fn_t nm_bdg_lookup; + + /* the forwarding table, MAC+ports */ + struct nm_hash_ent ht[NM_BDG_HASH]; }; struct nm_bridge nm_bridges[NM_BRIDGES]; +NM_LOCK_T netmap_bridge_mutex; -#define BDG_LOCK(b) mtx_lock(&(b)->bdg_lock) -#define BDG_UNLOCK(b) mtx_unlock(&(b)->bdg_lock) +/* other OS will have these macros defined in their own glue code. */ + +#ifdef __FreeBSD__ +#define BDG_LOCK() mtx_lock(&netmap_bridge_mutex) +#define BDG_UNLOCK() mtx_unlock(&netmap_bridge_mutex) +#define BDG_WLOCK(b) rw_wlock(&(b)->bdg_lock) +#define BDG_WUNLOCK(b) rw_wunlock(&(b)->bdg_lock) +#define BDG_RLOCK(b) rw_rlock(&(b)->bdg_lock) +#define BDG_RUNLOCK(b) rw_runlock(&(b)->bdg_lock) + +/* set/get variables. OS-specific macros may wrap these + * assignments into read/write lock or similar + */ +#define BDG_SET_VAR(lval, p) (lval = p) +#define BDG_GET_VAR(lval) (lval) +#define BDG_FREE(p) free(p, M_DEVBUF) +#endif /* __FreeBSD__ */ + +static __inline int +nma_is_vp(struct netmap_adapter *na) +{ + return na->nm_register == bdg_netmap_reg; +} +static __inline int +nma_is_host(struct netmap_adapter *na) +{ + return na->nm_register == NULL; +} +static __inline int +nma_is_hw(struct netmap_adapter *na) +{ + /* In case of sw adapter, nm_register is NULL */ + return !nma_is_vp(na) && !nma_is_host(na); +} + +/* + * Regarding holding a NIC, if the NIC is owned by the kernel + * (i.e., bridge), neither another bridge nor user can use it; + * if the NIC is owned by a user, only users can share it. + * Evaluation must be done under NMA_LOCK(). + */ +#define NETMAP_OWNED_BY_KERN(ifp) (!nma_is_vp(NA(ifp)) && NA(ifp)->na_bdg) +#define NETMAP_OWNED_BY_ANY(ifp) \ + (NETMAP_OWNED_BY_KERN(ifp) || (NA(ifp)->refcount > 0)) /* * NA(ifp)->bdg_port port index @@ -245,15 +318,16 @@ pkt_copy(void *_src, void *_dst, int l) } } + /* * locate a bridge among the existing ones. * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. * We assume that this is called with a name of at least NM_NAME chars. */ static struct nm_bridge * -nm_find_bridge(const char *name) +nm_find_bridge(const char *name, int create) { - int i, l, namelen, e; + int i, l, namelen; struct nm_bridge *b = NULL; namelen = strlen(NM_NAME); /* base length */ @@ -268,29 +342,94 @@ nm_find_bridge(const char *name) namelen = IFNAMSIZ; ND("--- prefix is '%.*s' ---", namelen, name); - /* use the first entry for locking */ - BDG_LOCK(nm_bridges); // XXX do better - for (e = -1, i = 1; i < NM_BRIDGES; i++) { - b = nm_bridges + i; - if (b->namelen == 0) - e = i; /* record empty slot */ - else if (strncmp(name, b->basename, namelen) == 0) { + BDG_LOCK(); + /* lookup the name, remember empty slot if there is one */ + for (i = 0; i < NM_BRIDGES; i++) { + struct nm_bridge *x = nm_bridges + i; + + if (x->namelen == 0) { + if (create && b == NULL) + b = x; /* record empty slot */ + } else if (x->namelen != namelen) { + continue; + } else if (strncmp(name, x->basename, namelen) == 0) { ND("found '%.*s' at %d", namelen, name, i); + b = x; break; } } - if (i == NM_BRIDGES) { /* all full */ - if (e == -1) { /* no empty slot */ - b = NULL; - } else { - b = nm_bridges + e; - strncpy(b->basename, name, namelen); - b->namelen = namelen; - } + if (i == NM_BRIDGES && b) { /* name not found, can create entry */ + strncpy(b->basename, name, namelen); + b->namelen = namelen; + /* set the default function */ + b->nm_bdg_lookup = netmap_bdg_learning; + /* reset the MAC address table */ + bzero(b->ht, sizeof(struct nm_hash_ent) * NM_BDG_HASH); } - BDG_UNLOCK(nm_bridges); + BDG_UNLOCK(); return b; } + + +/* + * Free the forwarding tables for rings attached to switch ports. + */ +static void +nm_free_bdgfwd(struct netmap_adapter *na) +{ + int nrings, i; + struct netmap_kring *kring; + + nrings = nma_is_vp(na) ? na->num_tx_rings : na->num_rx_rings; + kring = nma_is_vp(na) ? na->tx_rings : na->rx_rings; + for (i = 0; i < nrings; i++) { + if (kring[i].nkr_ft) { + free(kring[i].nkr_ft, M_DEVBUF); + kring[i].nkr_ft = NULL; /* protect from freeing twice */ + } + } + if (nma_is_hw(na)) + nm_free_bdgfwd(SWNA(na->ifp)); +} + + +/* + * Allocate the forwarding tables for the rings attached to the bridge ports. + */ +static int +nm_alloc_bdgfwd(struct netmap_adapter *na) +{ + int nrings, l, i, num_dstq; + struct netmap_kring *kring; + + /* all port:rings + broadcast */ + num_dstq = NM_BDG_MAXPORTS * NM_BDG_MAXRINGS + 1; + l = sizeof(struct nm_bdg_fwd) * NM_BDG_BATCH; + l += sizeof(struct nm_bdg_q) * num_dstq; + l += sizeof(uint16_t) * NM_BDG_BATCH; + + nrings = nma_is_vp(na) ? na->num_tx_rings : na->num_rx_rings; + kring = nma_is_vp(na) ? na->tx_rings : na->rx_rings; + for (i = 0; i < nrings; i++) { + struct nm_bdg_fwd *ft; + struct nm_bdg_q *dstq; + int j; + + ft = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!ft) { + nm_free_bdgfwd(na); + return ENOMEM; + } + dstq = (struct nm_bdg_q *)(ft + NM_BDG_BATCH); + for (j = 0; j < num_dstq; j++) + dstq[j].bq_head = dstq[j].bq_tail = NM_BDG_BATCH; + kring[i].nkr_ft = ft; + } + if (nma_is_hw(na)) + nm_alloc_bdgfwd(SWNA(na->ifp)); + return 0; +} + #endif /* NM_BRIDGE */ @@ -413,20 +552,11 @@ netmap_dtor_locked(void *data) if (netmap_verbose) D("deleting last instance for %s", ifp->if_xname); /* - * there is a race here with *_netmap_task() and - * netmap_poll(), which don't run under NETMAP_REG_LOCK. - * na->refcount == 0 && na->ifp->if_capenable & IFCAP_NETMAP - * (aka NETMAP_DELETING(na)) are a unique marker that the - * device is dying. - * Before destroying stuff we sleep a bit, and then complete - * the job. NIOCREG should realize the condition and - * loop until they can continue; the other routines - * should check the condition at entry and quit if - * they cannot run. + * (TO CHECK) This function is only called + * when the last reference to this file descriptor goes + * away. This means we cannot have any pending poll() + * or interrupt routine operating on the structure. */ - na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - tsleep(na, 0, "NIOCUNREG", 4); - na->nm_lock(ifp, NETMAP_REG_LOCK, 0); na->nm_register(ifp, 0); /* off, clear IFCAP_NETMAP */ /* Wake up any sleeping threads. netmap_poll will * then return POLLERR @@ -437,6 +567,9 @@ netmap_dtor_locked(void *data) selwakeuppri(&na->rx_rings[i].si, PI_NET); selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); +#ifdef NM_BRIDGE + nm_free_bdgfwd(na); +#endif /* NM_BRIDGE */ /* release all buffers */ for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; @@ -458,49 +591,81 @@ netmap_dtor_locked(void *data) /* knlist_destroy(&na->tx_si.si_note); */ /* knlist_destroy(&na->rx_si.si_note); */ netmap_free_rings(na); - wakeup(na); + if (nma_is_hw(na)) + SWNA(ifp)->tx_rings = SWNA(ifp)->rx_rings = NULL; } netmap_if_free(nifp); } + +/* we assume netmap adapter exists */ static void nm_if_rele(struct ifnet *ifp) { #ifndef NM_BRIDGE if_rele(ifp); #else /* NM_BRIDGE */ - int i, full; + int i, full = 0, is_hw; struct nm_bridge *b; + struct netmap_adapter *na; - if (strncmp(ifp->if_xname, NM_NAME, sizeof(NM_NAME) - 1)) { + /* I can be called not only for get_ifp()-ed references where netmap's + * capability is guaranteed, but also for non-netmap-capable NICs. + */ + if (!NETMAP_CAPABLE(ifp) || !NA(ifp)->na_bdg) { if_rele(ifp); return; } if (!DROP_BDG_REF(ifp)) return; - b = ifp->if_bridge; - BDG_LOCK(nm_bridges); - BDG_LOCK(b); + + na = NA(ifp); + b = na->na_bdg; + is_hw = nma_is_hw(na); + + BDG_WLOCK(b); ND("want to disconnect %s from the bridge", ifp->if_xname); full = 0; + /* remove the entry from the bridge, also check + * if there are any leftover interfaces + * XXX we should optimize this code, e.g. going directly + * to na->bdg_port, and having a counter of ports that + * are connected. But it is not in a critical path. + * In NIC's case, index of sw na is always higher than hw na + */ for (i = 0; i < NM_BDG_MAXPORTS; i++) { - if (b->bdg_ports[i] == ifp) { - b->bdg_ports[i] = NULL; - bzero(ifp, sizeof(*ifp)); - free(ifp, M_DEVBUF); - break; - } - else if (b->bdg_ports[i] != NULL) + struct netmap_adapter *tmp = BDG_GET_VAR(b->bdg_ports[i]); + + if (tmp == na) { + /* disconnect from bridge */ + BDG_SET_VAR(b->bdg_ports[i], NULL); + na->na_bdg = NULL; + if (is_hw && SWNA(ifp)->na_bdg) { + /* disconnect sw adapter too */ + int j = SWNA(ifp)->bdg_port; + BDG_SET_VAR(b->bdg_ports[j], NULL); + SWNA(ifp)->na_bdg = NULL; + } + } else if (tmp != NULL) { full = 1; + } } - BDG_UNLOCK(b); + BDG_WUNLOCK(b); if (full == 0) { - ND("freeing bridge %d", b - nm_bridges); + ND("marking bridge %d as free", b - nm_bridges); b->namelen = 0; + b->nm_bdg_lookup = NULL; } - BDG_UNLOCK(nm_bridges); - if (i == NM_BDG_MAXPORTS) + if (na->na_bdg) { /* still attached to the bridge */ D("ouch, cannot find ifp to remove"); + } else if (is_hw) { + if_rele(ifp); + } else { + bzero(na, sizeof(*na)); + free(na, M_DEVBUF); + bzero(ifp, sizeof(*ifp)); + free(ifp, M_DEVBUF); + } #endif /* NM_BRIDGE */ } @@ -514,9 +679,13 @@ netmap_dtor(void *data) if (ifp) { struct netmap_adapter *na = NA(ifp); + if (na->na_bdg) + BDG_WLOCK(na->na_bdg); na->nm_lock(ifp, NETMAP_REG_LOCK, 0); netmap_dtor_locked(data); na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + if (na->na_bdg) + BDG_WUNLOCK(na->na_bdg); nm_if_rele(ifp); /* might also destroy *na */ } @@ -528,6 +697,7 @@ netmap_dtor(void *data) free(priv, M_DEVBUF); } + #ifdef __FreeBSD__ #include #include @@ -536,8 +706,16 @@ netmap_dtor(void *data) #include #include +/* + * In order to track whether pages are still mapped, we hook into + * the standard cdev_pager and intercept the constructor and + * destructor. + * XXX but then ? Do we really use the information ? + * Need to investigate. + */ static struct cdev_pager_ops saved_cdev_pager_ops; + static int netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color) @@ -548,6 +726,7 @@ netmap_dev_pager_ctor(void *handle, vm_o size, prot, foff, cred, color); } + static void netmap_dev_pager_dtor(void *handle) { @@ -562,6 +741,8 @@ static struct cdev_pager_ops netmap_cdev .cdev_pg_fault = NULL, }; + +// XXX check whether we need netmap_mmap_single _and_ netmap_mmap static int netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, vm_size_t objsize, vm_object_t *objp, int prot) @@ -630,6 +811,7 @@ netmap_mmap(__unused struct cdev *dev, return (*paddr ? 0 : ENOMEM); } + static int netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { @@ -639,6 +821,7 @@ netmap_close(struct cdev *dev, int fflag return 0; } + static int netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { @@ -677,6 +860,7 @@ netmap_open(struct cdev *dev, int oflags * might take a while before releasing the buffer. */ + /* * pass a chain of buffers to the host stack as coming from 'dst' */ @@ -701,6 +885,7 @@ struct mbq { int count; }; + /* * put a copy of the buffers marked NS_FORWARD into an mbuf chain. * Run from hwcur to cur - reserved @@ -745,6 +930,7 @@ netmap_grab_packets(struct netmap_kring q->tail = tail; } + /* * called under main lock to send packets from the host to the NIC * The host ring has packets from nr_hwcur to (cur - reserved) @@ -794,6 +980,7 @@ netmap_sw_to_nic(struct netmap_adapter * } } + /* * netmap_sync_to_host() passes packets up. We are called from a * system call in user process context, and the only contention @@ -827,6 +1014,18 @@ netmap_sync_to_host(struct netmap_adapte netmap_send_up(na->ifp, q.head); } + +/* SWNA(ifp)->txrings[0] is always NA(ifp)->txrings[NA(ifp)->num_txrings] */ +static int +netmap_bdg_to_host(struct ifnet *ifp, u_int ring_nr, int do_lock) +{ + (void)ring_nr; + (void)do_lock; + netmap_sync_to_host(NA(ifp)); + return 0; +} + + /* * rxsync backend for packets coming from the host stack. * They have been put in the queue by netmap_start() so we @@ -881,38 +1080,60 @@ netmap_sync_from_host(struct netmap_adap * Return ENXIO if the interface does not exist, EINVAL if netmap * is not supported by the interface. * If successful, hold a reference. + * + * During the NIC is attached to a bridge, reference is managed + * at na->na_bdg_refcount using ADD/DROP_BDG_REF() as well as + * virtual ports. Hence, on the final DROP_BDG_REF(), the NIC + * is detached from the bridge, then ifp's refcount is dropped (this + * is equivalent to that ifp is destroyed in case of virtual ports. + * + * This function uses if_rele() when we want to prevent the NIC from + * being detached from the bridge in error handling. But once refcount + * is acquired by this function, it must be released using nm_if_rele(). */ static int -get_ifp(const char *name, struct ifnet **ifp) +get_ifp(struct nmreq *nmr, struct ifnet **ifp) { + const char *name = nmr->nr_name; + int namelen = strlen(name); #ifdef NM_BRIDGE struct ifnet *iter = NULL; + int no_prefix = 0; do { struct nm_bridge *b; - int i, l, cand = -1; + struct netmap_adapter *na; + int i, cand = -1, cand2 = -1; - if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) + if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) { + no_prefix = 1; break; - b = nm_find_bridge(name); + } + b = nm_find_bridge(name, 1 /* create a new one if no exist */ ); if (b == NULL) { D("no bridges available for '%s'", name); return (ENXIO); } - /* XXX locking */ - BDG_LOCK(b); + /* Now we are sure that name starts with the bridge's name */ + BDG_WLOCK(b); /* lookup in the local list of ports */ for (i = 0; i < NM_BDG_MAXPORTS; i++) { - iter = b->bdg_ports[i]; - if (iter == NULL) { + na = BDG_GET_VAR(b->bdg_ports[i]); + if (na == NULL) { if (cand == -1) cand = i; /* potential insert point */ + else if (cand2 == -1) + cand2 = i; /* for host stack */ continue; } - if (!strcmp(iter->if_xname, name)) { + iter = na->ifp; + /* XXX make sure the name only contains one : */ + if (!strcmp(iter->if_xname, name) /* virtual port */ || + (namelen > b->namelen && !strcmp(iter->if_xname, + name + b->namelen + 1)) /* NIC */) { ADD_BDG_REF(iter); ND("found existing interface"); - BDG_UNLOCK(b); + BDG_WUNLOCK(b); break; } } @@ -921,23 +1142,73 @@ get_ifp(const char *name, struct ifnet * if (cand == -1) { D("bridge full, cannot create new port"); no_port: - BDG_UNLOCK(b); + BDG_WUNLOCK(b); *ifp = NULL; return EINVAL; } ND("create new bridge port %s", name); - /* space for forwarding list after the ifnet */ - l = sizeof(*iter) + - sizeof(struct nm_bdg_fwd)*NM_BDG_BATCH ; - iter = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); - if (!iter) - goto no_port; - strcpy(iter->if_xname, name); - bdg_netmap_attach(iter); - b->bdg_ports[cand] = iter; - iter->if_bridge = b; + /* + * create a struct ifnet for the new port. + * The forwarding table is attached to the kring(s). + */ + /* + * try see if there is a matching NIC with this name + * (after the bridge's name) + */ + iter = ifunit_ref(name + b->namelen + 1); + if (!iter) { /* this is a virtual port */ + /* Create a temporary NA with arguments, then + * bdg_netmap_attach() will allocate the real one + * and attach it to the ifp + */ + struct netmap_adapter tmp_na; + + if (nmr->nr_cmd) /* nr_cmd must be for a NIC */ + goto no_port; + bzero(&tmp_na, sizeof(tmp_na)); + /* bound checking */ + if (nmr->nr_tx_rings < 1) + nmr->nr_tx_rings = 1; + if (nmr->nr_tx_rings > NM_BDG_MAXRINGS) + nmr->nr_tx_rings = NM_BDG_MAXRINGS; + tmp_na.num_tx_rings = nmr->nr_tx_rings; + if (nmr->nr_rx_rings < 1) + nmr->nr_rx_rings = 1; + if (nmr->nr_rx_rings > NM_BDG_MAXRINGS) + nmr->nr_rx_rings = NM_BDG_MAXRINGS; + tmp_na.num_rx_rings = nmr->nr_rx_rings; + + iter = malloc(sizeof(*iter), M_DEVBUF, M_NOWAIT | M_ZERO); + if (!iter) + goto no_port; + strcpy(iter->if_xname, name); + tmp_na.ifp = iter; + /* bdg_netmap_attach creates a struct netmap_adapter */ + bdg_netmap_attach(&tmp_na); + } else if (NETMAP_CAPABLE(iter)) { /* this is a NIC */ + /* cannot attach the NIC that any user or another + * bridge already holds. + */ + if (NETMAP_OWNED_BY_ANY(iter) || cand2 == -1) { +ifunit_rele: + if_rele(iter); /* don't detach from bridge */ + goto no_port; + } + /* bind the host stack to the bridge */ + if (nmr->nr_arg1 == NETMAP_BDG_HOST) { + BDG_SET_VAR(b->bdg_ports[cand2], SWNA(iter)); + SWNA(iter)->bdg_port = cand2; + SWNA(iter)->na_bdg = b; + } + } else /* not a netmap-capable NIC */ + goto ifunit_rele; + na = NA(iter); + na->bdg_port = cand; + /* bind the port to the bridge (virtual ports are not active) */ + BDG_SET_VAR(b->bdg_ports[cand], na); + na->na_bdg = b; ADD_BDG_REF(iter); - BDG_UNLOCK(b); + BDG_WUNLOCK(b); ND("attaching virtual bridge %p", b); } while (0); *ifp = iter; @@ -949,8 +1220,16 @@ no_port: /* can do this if the capability exists and if_pspare[0] * points to the netmap descriptor. */ - if (NETMAP_CAPABLE(*ifp)) + if (NETMAP_CAPABLE(*ifp)) { +#ifdef NM_BRIDGE + /* Users cannot use the NIC attached to a bridge directly */ + if (no_prefix && NETMAP_OWNED_BY_KERN(*ifp)) { + if_rele(*ifp); /* don't detach from bridge */ + return EINVAL; + } else +#endif /* NM_BRIDGE */ return 0; /* valid pointer, we hold the refcount */ + } nm_if_rele(*ifp); return EINVAL; // not NETMAP capable } @@ -1059,6 +1338,296 @@ netmap_set_ringid(struct netmap_priv_d * return 0; } + +/* + * possibly move the interface to netmap-mode. + * If success it returns a pointer to netmap_if, otherwise NULL. + * This must be called with NMA_LOCK held. + */ +static struct netmap_if * +netmap_do_regif(struct netmap_priv_d *priv, struct ifnet *ifp, + uint16_t ringid, int *err) +{ + struct netmap_adapter *na = NA(ifp); + struct netmap_if *nifp = NULL; + int i, error; + + if (na->na_bdg) + BDG_WLOCK(na->na_bdg); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); + + /* ring configuration may have changed, fetch from the card */ + netmap_update_config(na); + priv->np_ifp = ifp; /* store the reference */ + error = netmap_set_ringid(priv, ringid); + if (error) + goto out; + nifp = netmap_if_new(ifp->if_xname, na); + if (nifp == NULL) { /* allocation failed */ + error = ENOMEM; + } else if (ifp->if_capenable & IFCAP_NETMAP) { + /* was already set */ + } else { + /* Otherwise set the card in netmap mode + * and make it use the shared buffers. + */ + for (i = 0 ; i < na->num_tx_rings + 1; i++) + mtx_init(&na->tx_rings[i].q_lock, "nm_txq_lock", + MTX_NETWORK_LOCK, MTX_DEF); + for (i = 0 ; i < na->num_rx_rings + 1; i++) { + mtx_init(&na->rx_rings[i].q_lock, "nm_rxq_lock", + MTX_NETWORK_LOCK, MTX_DEF); + } + if (nma_is_hw(na)) { + SWNA(ifp)->tx_rings = &na->tx_rings[na->num_tx_rings]; + SWNA(ifp)->rx_rings = &na->rx_rings[na->num_rx_rings]; + } + error = na->nm_register(ifp, 1); /* mode on */ +#ifdef NM_BRIDGE + if (!error) + error = nm_alloc_bdgfwd(na); +#endif /* NM_BRIDGE */ + if (error) { + netmap_dtor_locked(priv); + /* nifp is not yet in priv, so free it separately */ + netmap_if_free(nifp); + nifp = NULL; + } + + } +out: + *err = error; + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + if (na->na_bdg) + BDG_WUNLOCK(na->na_bdg); + return nifp; +} + + +/* Process NETMAP_BDG_ATTACH and NETMAP_BDG_DETACH */ +static int +kern_netmap_regif(struct nmreq *nmr) +{ + struct ifnet *ifp; + struct netmap_if *nifp; + struct netmap_priv_d *npriv; + int error; + + npriv = malloc(sizeof(*npriv), M_DEVBUF, M_NOWAIT|M_ZERO); + if (npriv == NULL) + return ENOMEM; + error = netmap_get_memory(npriv); + if (error) { +free_exit: + bzero(npriv, sizeof(*npriv)); + free(npriv, M_DEVBUF); + return error; + } + + NMA_LOCK(); + error = get_ifp(nmr, &ifp); + if (error) { /* no device, or another bridge or user owns the device */ + NMA_UNLOCK(); + goto free_exit; + } else if (!NETMAP_OWNED_BY_KERN(ifp)) { + /* got reference to a virtual port or direct access to a NIC. + * perhaps specified no bridge's prefix or wrong NIC's name + */ + error = EINVAL; +unref_exit: + nm_if_rele(ifp); + NMA_UNLOCK(); + goto free_exit; + } + + if (nmr->nr_cmd == NETMAP_BDG_DETACH) { + if (NA(ifp)->refcount == 0) { /* not registered */ + error = EINVAL; + goto unref_exit; + } + NMA_UNLOCK(); + + netmap_dtor(NA(ifp)->na_kpriv); /* unregister */ + NA(ifp)->na_kpriv = NULL; + nm_if_rele(ifp); /* detach from the bridge */ + goto free_exit; + } else if (NA(ifp)->refcount > 0) { /* already registered */ + error = EINVAL; + goto unref_exit; + } + + nifp = netmap_do_regif(npriv, ifp, nmr->nr_ringid, &error); + if (!nifp) + goto unref_exit; + wmb(); // XXX do we need it ? + npriv->np_nifp = nifp; + NA(ifp)->na_kpriv = npriv; + NMA_UNLOCK(); + D("registered %s to netmap-mode", ifp->if_xname); + return 0; +} + + +/* CORE_LOCK is not necessary */ +static void +netmap_swlock_wrapper(struct ifnet *dev, int what, u_int queueid) +{ + struct netmap_adapter *na = SWNA(dev); + + switch (what) { + case NETMAP_TX_LOCK: + mtx_lock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_TX_UNLOCK: + mtx_unlock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_RX_LOCK: + mtx_lock(&na->rx_rings[queueid].q_lock); + break; + + case NETMAP_RX_UNLOCK: + mtx_unlock(&na->rx_rings[queueid].q_lock); + break; + } +} + + +/* Initialize necessary fields of sw adapter located in right after hw's + * one. sw adapter attaches a pair of sw rings of the netmap-mode NIC. + * It is always activated and deactivated at the same tie with the hw's one. + * Thus we don't need refcounting on the sw adapter. + * Regardless of NIC's feature we use separate lock so that anybody can lock + * me independently from the hw adapter. + * Make sure nm_register is NULL to be handled as FALSE in nma_is_hw + */ +static void +netmap_attach_sw(struct ifnet *ifp) +{ + struct netmap_adapter *hw_na = NA(ifp); + struct netmap_adapter *na = SWNA(ifp); + + na->ifp = ifp; + na->separate_locks = 1; + na->nm_lock = netmap_swlock_wrapper; + na->num_rx_rings = na->num_tx_rings = 1; + na->num_tx_desc = hw_na->num_tx_desc; + na->num_rx_desc = hw_na->num_rx_desc; + na->nm_txsync = netmap_bdg_to_host; +} + + +/* exported to kernel callers */ +int +netmap_bdg_ctl(struct nmreq *nmr, bdg_lookup_fn_t func) +{ + struct nm_bridge *b; + struct netmap_adapter *na; + struct ifnet *iter; + char *name = nmr->nr_name; + int cmd = nmr->nr_cmd, namelen = strlen(name); + int error = 0, i, j; + + switch (cmd) { + case NETMAP_BDG_ATTACH: + case NETMAP_BDG_DETACH: + error = kern_netmap_regif(nmr); + break; + + case NETMAP_BDG_LIST: + /* this is used to enumerate bridges and ports */ + if (namelen) { /* look up indexes of bridge and port */ + if (strncmp(name, NM_NAME, strlen(NM_NAME))) { + error = EINVAL; + break; + } + b = nm_find_bridge(name, 0 /* don't create */); + if (!b) { + error = ENOENT; + break; + } + + BDG_RLOCK(b); + error = ENOENT; + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + na = BDG_GET_VAR(b->bdg_ports[i]); + if (na == NULL) + continue; + iter = na->ifp; + /* the former and the latter identify a + * virtual port and a NIC, respectively + */ + if (!strcmp(iter->if_xname, name) || + (namelen > b->namelen && + !strcmp(iter->if_xname, + name + b->namelen + 1))) { + /* bridge index */ + nmr->nr_arg1 = b - nm_bridges; + nmr->nr_arg2 = i; /* port index */ + error = 0; + break; + } + } + BDG_RUNLOCK(b); + } else { + /* return the first non-empty entry starting from + * bridge nr_arg1 and port nr_arg2. + * + * Users can detect the end of the same bridge by + * seeing the new and old value of nr_arg1, and can + * detect the end of all the bridge by error != 0 + */ + i = nmr->nr_arg1; + j = nmr->nr_arg2; + + for (error = ENOENT; error && i < NM_BRIDGES; i++) { + b = nm_bridges + i; + BDG_RLOCK(b); + for (; j < NM_BDG_MAXPORTS; j++) { + na = BDG_GET_VAR(b->bdg_ports[j]); + if (na == NULL) + continue; + iter = na->ifp; + nmr->nr_arg1 = i; + nmr->nr_arg2 = j; + strncpy(name, iter->if_xname, IFNAMSIZ); + error = 0; + break; + } + BDG_RUNLOCK(b); + j = 0; /* following bridges scan from 0 */ + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 30 14:09:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26040B7F; Thu, 30 May 2013 14:09:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F20F3641; Thu, 30 May 2013 14:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UE9wqq009397; Thu, 30 May 2013 14:09:58 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UE9wSP009396; Thu, 30 May 2013 14:09:58 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305301409.r4UE9wSP009396@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 14:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251140 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 14:09:59 -0000 Author: brooks Date: Thu May 30 14:09:58 2013 New Revision: 251140 URL: http://svnweb.freebsd.org/changeset/base/251140 Log: Always define INSTALL_DDIR and define it such that it contains no extra / characters rather than removing them later on. This should fix release builds. PR: conf/178963 Reviewed by: gjb, hrs Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) @@ -407,11 +407,12 @@ IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc .endif +_INSTALL_DDIR= ${DESTDIR}/${DISTDIR} +INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} .if defined(NO_ROOT) METALOG?= ${DESTDIR}/${DISTDIR}/METALOG IMAKE+= -DNO_ROOT METALOG=${METALOG} -INSTALL_DDIR= ${DESTDIR}/${DISTDIR} -INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR:S://:/:g:C:/$::} +INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} MTREEFLAGS+= -W .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) @@ -522,7 +523,7 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4.1: building includes" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes _libraries: @echo @echo "--------------------------------------------------------------" @@ -1014,7 +1015,7 @@ distributekernel distributekernel.debug: cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ - DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel \ + DESTDIR=${INSTALL_DDIR}/kernel \ ${.TARGET:S/distributekernel/install/} .if defined(NO_ROOT) sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ @@ -1028,7 +1029,7 @@ distributekernel distributekernel.debug: ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \ KERNEL=${INSTKERNNAME}.${_kernel} \ - DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel.${_kernel} \ + DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \ ${.TARGET:S/distributekernel/install/} sed -e 's|^./kernel|.|' \ ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ From owner-svn-src-head@FreeBSD.ORG Thu May 30 14:53:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E8B591B; Thu, 30 May 2013 14:53:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id DFE7CA13; Thu, 30 May 2013 14:53:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5E4BDB918; Thu, 30 May 2013 10:53:45 -0400 (EDT) From: John Baldwin To: Brooks Davis Subject: Re: svn commit: r251140 - head Date: Thu, 30 May 2013 10:53:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305301409.r4UE9wSP009396@svn.freebsd.org> In-Reply-To: <201305301409.r4UE9wSP009396@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305301053.23282.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 30 May 2013 10:53:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 14:53:46 -0000 On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > Author: brooks > Date: Thu May 30 14:09:58 2013 > New Revision: 251140 > URL: http://svnweb.freebsd.org/changeset/base/251140 > > Log: > Always define INSTALL_DDIR and define it such that it contains no extra > / characters rather than removing them later on. This should fix > release builds. > > PR: conf/178963 > Reviewed by: gjb, hrs > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > @@ -522,7 +523,7 @@ _includes: > @echo "--------------------------------------------------------------" > @echo ">>> stage 4.1: building includes" > @echo "--------------------------------------------------------------" > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > _libraries: > @echo > @echo "--------------------------------------------------------------" Did you mean to change this? It seems unrelated. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:25:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CE22A98; Thu, 30 May 2013 15:25:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F030DDD; Thu, 30 May 2013 15:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UFPsn7036662; Thu, 30 May 2013 15:25:54 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UFPsfU036661; Thu, 30 May 2013 15:25:54 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305301525.r4UFPsfU036661@svn.freebsd.org> From: Brooks Davis Date: Thu, 30 May 2013 15:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251141 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:25:54 -0000 Author: brooks Date: Thu May 30 15:25:54 2013 New Revision: 251141 URL: http://svnweb.freebsd.org/changeset/base/251141 Log: Restore (at least temporarily) SHARED=symlinks in the build includes stage of buildworld. This was accidentally included in r251140. Reported by: jhb Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) +++ head/Makefile.inc1 Thu May 30 15:25:54 2013 (r251141) @@ -523,7 +523,7 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4.1: building includes" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes + ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes _libraries: @echo @echo "--------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:29:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E66FD103; Thu, 30 May 2013 15:29:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id AD752E76; Thu, 30 May 2013 15:29:34 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4UFTXmY037174; Thu, 30 May 2013 10:29:33 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4UFTXOA037173; Thu, 30 May 2013 10:29:33 -0500 (CDT) (envelope-from brooks) Date: Thu, 30 May 2013 10:29:33 -0500 From: Brooks Davis To: John Baldwin Subject: Re: svn commit: r251140 - head Message-ID: <20130530152933.GB36644@lor.one-eyed-alien.net> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: <201305301053.23282.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:29:36 -0000 --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > Author: brooks > > Date: Thu May 30 14:09:58 2013 > > New Revision: 251140 > > URL: http://svnweb.freebsd.org/changeset/base/251140 > >=20 > > Log: > > Always define INSTALL_DDIR and define it such that it contains no ext= ra > > / characters rather than removing them later on. This should fix > > release builds. > > =20 > > PR: conf/178963 > > Reviewed by: gjb, hrs > >=20 > > Modified: > > head/Makefile.inc1 > >=20 > > Modified: head/Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > @@ -522,7 +523,7 @@ _includes: > > @echo "--------------------------------------------------------------" > > @echo ">>> stage 4.1: building includes" > > @echo "--------------------------------------------------------------" > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > _libraries: > > @echo > > @echo "--------------------------------------------------------------" >=20 > Did you mean to change this? It seems unrelated. Oops, I forgot that I had that in for testing. Reverted in 251141. That said, the SHARED=3D(copies|symlinks) code should probably go on the chopping block. It's a lousy idea except for populating WORLDTMP and here it saves at most 1.5% in /usr/obj. Worse, the implementation is hand coded in each Makefile so it adds complexity for a mostly useless feature. -- Brooks --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRp3BdXY6L6fI4GtQRAm5/AJ47DB36CE0dJmFnDGZaUroYGAhhMwCgqCr2 zgUi+OupTRTuB5zOgeyiGMw= =Qqsd -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS-- From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:37:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA9A04C9; Thu, 30 May 2013 15:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 14BB7F5D; Thu, 30 May 2013 15:37:54 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r4UFbpSj090176; Thu, 30 May 2013 18:37:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r4UFbpSj090176 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r4UFbpTl090175; Thu, 30 May 2013 18:37:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 May 2013 18:37:51 +0300 From: Konstantin Belousov To: Brooks Davis Subject: Re: svn commit: r251140 - head Message-ID: <20130530153750.GB3047@kib.kiev.ua> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PYiEBKzE38FzKR5p" Content-Disposition: inline In-Reply-To: <20130530152933.GB36644@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:37:55 -0000 --PYiEBKzE38FzKR5p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:29:33AM -0500, Brooks Davis wrote: > On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > > Author: brooks > > > Date: Thu May 30 14:09:58 2013 > > > New Revision: 251140 > > > URL: http://svnweb.freebsd.org/changeset/base/251140 > > >=20 > > > Log: > > > Always define INSTALL_DDIR and define it such that it contains no e= xtra > > > / characters rather than removing them later on. This should fix > > > release builds. > > > =20 > > > PR: conf/178963 > > > Reviewed by: gjb, hrs > > >=20 > > > Modified: > > > head/Makefile.inc1 > > >=20 > > > Modified: head/Makefile.inc1 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > > @@ -522,7 +523,7 @@ _includes: > > > @echo "------------------------------------------------------------= --" > > > @echo ">>> stage 4.1: building includes" > > > @echo "------------------------------------------------------------= --" > > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > > _libraries: > > > @echo > > > @echo "------------------------------------------------------------= --" > >=20 > > Did you mean to change this? It seems unrelated. >=20 > Oops, I forgot that I had that in for testing. Reverted in 251141. >=20 > That said, the SHARED=3D(copies|symlinks) code should probably go on the > chopping block. It's a lousy idea except for populating WORLDTMP and > here it saves at most 1.5% in /usr/obj. Worse, the implementation is > hand coded in each Makefile so it adds complexity for a mostly useless > feature. I disagree with the statement about the useless, at least for WORLDTMP it saves the full buildworld when a change in the usermode headers is done during the development. E.g., changing include/* or sys/sys/* still allows to build libc with buildenv, instead of spending 40+ minutes on the buildworld. --PYiEBKzE38FzKR5p Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRp3JOAAoJEJDCuSvBvK1BJQ8P/3sAS5LuOYQG6emQ8xMUdAz8 +f+0229U/r8XmujWOcDuU/C3sq1xrj4mSLFvTGtsicwmAWyiRgAcm33EW/o/fdH/ pxZFeYre/nRJhIbJ75JqrON3l07i8C6N6+dHqruv3hPLCRJ5pBW3dEDAnF1rjWJU vCVgaVhm0L8eViEPL2MZvV7m614HnKbd6uWpFP8mdHw2W/4tvjDg8fHo45ndJXv9 f4vcmne716x4+2BAKlMwJWplotGDnVUP7GUD9g+aclKriCxkiVtLZeSTEFLfeXHk SZW4tP68KIUrzvuSVzs7GGNjpLI0sgdq616PP5R4VbKGJLbHUB+5Sri5etJn+fIz K5RPkFLvznDfG9XjViM2cFt4PFTId/in8nxArQD6lelQpT7qMzN6PGwkcMqT3HHv AELmq9SiUzdznQ2/5/JtwtpWL55/WU0wdx3IXlYJiC9tBMhsIjAZxv/YJddGWqBb 4uPvTl2a/jUHV+a/yLmJrKiUm514+RL5MLfyKZukSTWIF5ssAS7H7VdrCvPPeVXP +pqxIqE5sJFASVv2A/ZxbvFS5+cT/DW9rIbAKZ5uoihtTfsc80lO+cDvlUI6kqQf ZN1qS7LKF0aizmxQCPeUT9nyJiw6/izP1qBZHhj+qAsOqg+p9L4iBI+yxRZY1bYP szRgHgytHXkHnJIxX426 =yGXJ -----END PGP SIGNATURE----- --PYiEBKzE38FzKR5p-- From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:45:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03165C2C; Thu, 30 May 2013 15:45:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 52E48C1; Thu, 30 May 2013 15:45:34 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4UFjSsx037346; Thu, 30 May 2013 10:45:28 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4UFjScZ037345; Thu, 30 May 2013 10:45:28 -0500 (CDT) (envelope-from brooks) Date: Thu, 30 May 2013 10:45:28 -0500 From: Brooks Davis To: Konstantin Belousov Subject: Re: svn commit: r251140 - head Message-ID: <20130530154528.GC36644@lor.one-eyed-alien.net> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: <20130530153750.GB3047@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:45:35 -0000 --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: > On Thu, May 30, 2013 at 10:29:33AM -0500, Brooks Davis wrote: > > On Thu, May 30, 2013 at 10:53:23AM -0400, John Baldwin wrote: > > > On Thursday, May 30, 2013 10:09:58 am Brooks Davis wrote: > > > > Author: brooks > > > > Date: Thu May 30 14:09:58 2013 > > > > New Revision: 251140 > > > > URL: http://svnweb.freebsd.org/changeset/base/251140 > > > >=20 > > > > Log: > > > > Always define INSTALL_DDIR and define it such that it contains no= extra > > > > / characters rather than removing them later on. This should fix > > > > release builds. > > > > =20 > > > > PR: conf/178963 > > > > Reviewed by: gjb, hrs > > > >=20 > > > > Modified: > > > > head/Makefile.inc1 > > > >=20 > > > > Modified: head/Makefile.inc1 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Thu May 30 14:07:14 2013 (r251139) > > > > +++ head/Makefile.inc1 Thu May 30 14:09:58 2013 (r251140) > > > > @@ -522,7 +523,7 @@ _includes: > > > > @echo "----------------------------------------------------------= ----" > > > > @echo ">>> stage 4.1: building includes" > > > > @echo "----------------------------------------------------------= ----" > > > > - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=3Dsymlinks par-includes > > > > + ${_+_}cd ${.CURDIR}; ${WMAKE} par-includes > > > > _libraries: > > > > @echo > > > > @echo "----------------------------------------------------------= ----" > > >=20 > > > Did you mean to change this? It seems unrelated. > >=20 > > Oops, I forgot that I had that in for testing. Reverted in 251141. > >=20 > > That said, the SHARED=3D(copies|symlinks) code should probably go on the > > chopping block. It's a lousy idea except for populating WORLDTMP and > > here it saves at most 1.5% in /usr/obj. Worse, the implementation is > > hand coded in each Makefile so it adds complexity for a mostly useless > > feature. >=20 > I disagree with the statement about the useless, at least for WORLDTMP > it saves the full buildworld when a change in the usermode headers is > done during the development. E.g., changing include/* or sys/sys/* > still allows to build libc with buildenv, instead of spending 40+ > minutes on the buildworld. Ok, that's fair. I won't touch the includes bits. I seriously doubt 40+ minutes given that -DNO_CLEAN should work fine in such a case. Do you agree that it's less than useful in the never exercised cases in share/examples and share/sendmail? -- Brooks --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRp3QXXY6L6fI4GtQRAuHnAKCJ9xdpsqEWnw1hWF+M8r7Gs21vWgCfRPl1 iPKZTWuL237Vcn8DE4Prf/U= =aGQY -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu-- From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:50:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CD4CF94; Thu, 30 May 2013 15:50:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B60AB11E; Thu, 30 May 2013 15:50:29 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r4UFoPiE095396; Thu, 30 May 2013 18:50:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r4UFoPiE095396 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r4UFoP9j095394; Thu, 30 May 2013 18:50:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 May 2013 18:50:25 +0300 From: Konstantin Belousov To: Brooks Davis Subject: Re: svn commit: r251140 - head Message-ID: <20130530155025.GD3047@kib.kiev.ua> References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> <20130530154528.GC36644@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cs+qLuUypMIXhRuC" Content-Disposition: inline In-Reply-To: <20130530154528.GC36644@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:50:30 -0000 --Cs+qLuUypMIXhRuC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 10:45:28AM -0500, Brooks Davis wrote: > On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: > > I disagree with the statement about the useless, at least for WORLDTMP > > it saves the full buildworld when a change in the usermode headers is > > done during the development. E.g., changing include/* or sys/sys/* > > still allows to build libc with buildenv, instead of spending 40+ > > minutes on the buildworld. >=20 > Ok, that's fair. I won't touch the includes bits. I seriously doubt > 40+ minutes given that -DNO_CLEAN should work fine in such a case. -DNO_CLEAN have very strange failure modes, esp. recently. >=20 > Do you agree that it's less than useful in the never exercised cases in > share/examples and share/sendmail? I only care about includes, at least for now. --Cs+qLuUypMIXhRuC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRp3VAAAoJEJDCuSvBvK1B4MgQAJYjITTUVNwj6zLOwtRVa5Pn jUBvPzMz+x6zdYMWnxJ9pqdzCWyXT4sqsnaTmVgKAVOzVtVM46MbGGGCUaL7jg2p HtbeorMrgIcJuabawaRjJh5ZgG0lpSs+uTfvW8TLjFCVmdhp+sbpx8b+/Kamu6Y+ d8Fcnpcfcg7kr7/oGYN/vGdUjlTHEbfscwQc0RRu0WcenZUGkFMpTa2l9q8yEUu7 +OYg7W3t6iqkjcc9fVd7UQVJGxz4zSNKRrlGvV22nZZ/MH9fBkkPuWu+JZ/qrxNn pFL8nPGkspltEpfJAgP0fTcNDeFy2ZsPf/tMEgucR7HARkPJLT8pnijMZcTvRQTG oISAMmOk6Gg5CrDW6Hnnnp97gXyPNJWT+47yjp63naBTo0eqnxT/U99Qec6fXQd2 fs2SdEvAs/HgFXY8lKlpGyCPmpQf+jabRc5nabbWezDXJ3y75G8e0oVcJMRoULNO W5Qs+o2SVEt4iX8zx37oQ6UaTY1SjV/wJT9fnFO4Khpi68y+O+FdWaSoUEO3H/GD bfr4eDR7Q1Nvz8vwRDMzAGC0gwsl6+3zNi9KFnInsjYbePSzZIGxH2wiBGwqTMWS x5ye3VOaMR7d4rib8l2E8BWQFbeCo7ysUYHBsoDmAYA+CNR0HBZtWm4mrqHDZASa 7yn17r8qDTZBUM5ld3ng =NbE8 -----END PGP SIGNATURE----- --Cs+qLuUypMIXhRuC-- From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:52:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 384E81E0; Thu, 30 May 2013 15:52:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id F1FF5138; Thu, 30 May 2013 15:52:15 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id un4so585417pbc.26 for ; Thu, 30 May 2013 08:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=ahp5jJUEAx2MRG0/urXVELdcD9od1QqbqAGYhNyQAIw=; b=YA/4th1xIUzBHhZy9ytK3FRbGty3LQV/kBuwRVwZlXmahafGnViMxK7leYNDRJihoL LOyhZsbMUnY4VqDgmuq9hC96LwwDG0Er3KdiFLwf1avbWyCHVkypGVrv+oCwVhPz+0RH TYqhJzYN3FwLaG8WliH35YjLRhg/y401rI4qSkZMPgdYTScH74NefgRUgTOMg5mdt8qA hjd7BxJBShgKhCqIrwteR57QDfM42wuIUvAw1ob4F4LC1ekHfKzWIwzVCARyOl2hfzeF lCdTnHlM0qm4tpNliCvGn/qN38lefCAnGqc44LfmprFj3Dh3lczGSWBZtFmfexaAqUz/ DuXA== X-Received: by 10.66.134.41 with SMTP id ph9mr9258485pab.150.1369929135823; Thu, 30 May 2013 08:52:15 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id bs2sm45369325pad.17.2013.05.30.08.52.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 08:52:14 -0700 (PDT) Subject: Re: svn commit: r251140 - head Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <20130530155025.GD3047@kib.kiev.ua> Date: Thu, 30 May 2013 08:52:10 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201305301409.r4UE9wSP009396@svn.freebsd.org> <201305301053.23282.jhb@freebsd.org> <20130530152933.GB36644@lor.one-eyed-alien.net> <20130530153750.GB3047@kib.kiev.ua> <20130530154528.GC36644@lor.one-eyed-alien.net> <20130530155025.GD3047@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:52:16 -0000 On May 30, 2013, at 8:50 AM, Konstantin Belousov wrote: > On Thu, May 30, 2013 at 10:45:28AM -0500, Brooks Davis wrote: >> On Thu, May 30, 2013 at 06:37:51PM +0300, Konstantin Belousov wrote: >>> I disagree with the statement about the useless, at least for WORLDTMP >>> it saves the full buildworld when a change in the usermode headers is >>> done during the development. E.g., changing include/* or sys/sys/* >>> still allows to build libc with buildenv, instead of spending 40+ >>> minutes on the buildworld. >> >> Ok, that's fair. I won't touch the includes bits. I seriously doubt >> 40+ minutes given that -DNO_CLEAN should work fine in such a case. > -DNO_CLEAN have very strange failure modes, esp. recently. How "recent" is "recently", e.g. after the fmake -> bmake migration? Cheers, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu May 30 15:56:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5A6341E; Thu, 30 May 2013 15:56:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-x234.google.com (mail-pb0-x234.google.com [IPv6:2607:f8b0:400e:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id 9806317E; Thu, 30 May 2013 15:56:38 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id xa12so595033pbc.39 for ; Thu, 30 May 2013 08:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=nF4BJWIDsBKeRovce/e38Sr0Dx1OV+mbygvHH9L065o=; b=F9haGIRJMuTX9zz/fI75jjwuVOgcr2tu8FgfbRMnlEcG7uk/07vEAYggmfcHSHerw7 Xkeis5sVGWsEk40kz0Km5L9YP+cQQ9ZXIPil+kZDXIi/wDjVb+J9E0rO8y9LQ1gsW7Xr 1Q6mifTucS33NZvcvXsdbeirYnfB14uLhtoEisCv5tM5HgI0DFilKB1GTclgOUC4ILCi NEbDHPKjzH3IYZiuVbNVGciZHvjFq5u+QeuRm5/0GIjz8vo0w1dIohxyBPm5RiQkjAYN L8u5IWnNI58imZ4uJLS7HN2Z5QJRyxYdNOhPgh8GJ89x7tJBfQgt1MhrkUERsgnCo8jq 741w== X-Received: by 10.69.2.228 with SMTP id br4mr8540930pbd.91.1369929398348; Thu, 30 May 2013 08:56:38 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id ra4sm45413339pab.9.2013.05.30.08.56.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 08:56:36 -0700 (PDT) Subject: Re: svn commit: r251140 - head Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201305301409.r4UE9wSP009396@svn.freebsd.org> Date: Thu, 30 May 2013 08:56:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305301409.r4UE9wSP009396@svn.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, hrs@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 15:56:38 -0000 On May 30, 2013, at 7:09 AM, Brooks Davis wrote: > Author: brooks > Date: Thu May 30 14:09:58 2013 > New Revision: 251140 > URL: http://svnweb.freebsd.org/changeset/base/251140 >=20 > Log: > Always define INSTALL_DDIR and define it such that it contains no = extra > / characters rather than removing them later on. This should fix > release builds. >=20 > PR: conf/178963 > Reviewed by: gjb, hrs This is similar to a fix/enhancement I've made to Makefile.inc1 on my = atf-tools-regression-convert branch: = https://github.com/yaneurabeya/freebsd/blob/atf-tools-regression-convert/M= akefile.inc1 . There are two key differences between my changes and this one: 1. I more consistently used INSTALL_DDIR in the Makefile as there were a = number of spots where it wasn't doing that, but instead explicitly = stating ${DESTDIR}/${DISTDIR}. 2. I properly deal with removing adjacent / by using the {2,} regexp = quantifier as the current code only deals with even number of repeating = /, not odd number of repeating / (not sure why this even mattered in the = first place because this should be properly handled by whatever tool is = calculating the absolute path, but I won't question why this is being = done any further). Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Thu May 30 16:09:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 187C4932; Thu, 30 May 2013 16:09:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0ACAC248; Thu, 30 May 2013 16:09:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UG9vWK051401; Thu, 30 May 2013 16:09:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UG9u2O051398; Thu, 30 May 2013 16:09:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301609.r4UG9u2O051398@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 16:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251142 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 16:09:57 -0000 Author: marius Date: Thu May 30 16:09:56 2013 New Revision: 251142 URL: http://svnweb.freebsd.org/changeset/base/251142 Log: - As a follow-up to r247565, make firmware images that do not require patching at runtime actually const. - Remove pointless softc members by employing the corresponding constants directly. - Remove pointless returns. - Remove unnecessary inclusion of opt_device_polling.h. - Replace an outdated and now bogus comment in bce_tick() with the appropriate one. MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcefw.h head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bce.c Thu May 30 16:09:56 2013 (r251142) @@ -375,7 +375,8 @@ static void bce_release_resources (struc /****************************************************************************/ static void bce_fw_cap_init (struct bce_softc *); static int bce_fw_sync (struct bce_softc *, u32); -static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); +static void bce_load_rv2p_fw (struct bce_softc *, const u32 *, u32, + u32); static void bce_load_cpu_fw (struct bce_softc *, struct cpu_reg *, struct fw_info *); static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); @@ -1019,7 +1020,6 @@ bce_set_tunables(struct bce_softc *sc) sc->bce_tx_ticks = DEFAULT_TX_TICKS; sc->bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; } - } @@ -1332,23 +1332,6 @@ bce_attach(device_t dev) /* Fetch the permanent Ethernet MAC address. */ bce_get_mac_addr(sc); - /* - * Trip points control how many BDs - * should be ready before generating an - * interrupt while ticks control how long - * a BD can sit in the chain before - * generating an interrupt. Set the default - * values for the RX and TX chains. - */ - - /* Not used for L2. */ - sc->bce_comp_prod_trip_int = 0; - sc->bce_comp_prod_trip = 0; - sc->bce_com_ticks_int = 0; - sc->bce_com_ticks = 0; - sc->bce_cmd_ticks_int = 0; - sc->bce_cmd_ticks = 0; - /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; @@ -1935,7 +1918,6 @@ bce_miibus_read_reg(device_t dev, int ph DB_PRINT_PHY_REG(reg, val); return (val & 0xffff); - } @@ -3037,7 +3019,6 @@ bce_get_rx_buffer_sizes(struct bce_softc roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - sc->rx_bd_mbuf_align_pad; - sc->pg_bd_mbuf_alloc_size = MCLBYTES; } else { if ((mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN) > MCLBYTES) { @@ -3067,7 +3048,6 @@ bce_get_rx_buffer_sizes(struct bce_softc sc->rx_bd_mbuf_align_pad); DBEXIT(BCE_VERBOSE_LOAD); - } /****************************************************************************/ @@ -3484,8 +3464,6 @@ bce_dma_map_addr(void *arg, bus_dma_segm } else { *busaddr = segs->ds_addr; } - - return; } @@ -3793,21 +3771,17 @@ bce_dma_alloc(device_t dev) * Create a DMA tag for RX mbufs. */ if (bce_hdr_split == TRUE) - max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? + max_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? MCLBYTES : sc->rx_bd_mbuf_alloc_size); else - max_size = max_seg_size = MJUM9BYTES; - max_segments = 1; + max_size = MJUM9BYTES; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " - "(max size = 0x%jX max segments = %d, max segment " - "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, - max_segments, (uintmax_t) max_seg_size); + "(max size = 0x%jX)\n", __FUNCTION__, (uintmax_t)max_size); if (bus_dma_tag_create(sc->parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - max_size, max_segments, max_seg_size, 0, NULL, NULL, - &sc->rx_mbuf_tag)) { + max_size, 1, max_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate RX mbuf DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3873,12 +3847,9 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for page mbufs. */ - max_size = max_seg_size = ((sc->pg_bd_mbuf_alloc_size < MCLBYTES) ? - MCLBYTES : sc->pg_bd_mbuf_alloc_size); - if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, - sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - max_size, 1, max_seg_size, 0, NULL, NULL, &sc->pg_mbuf_tag)) { + sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, + 1, MCLBYTES, 0, NULL, NULL, &sc->pg_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate page mbuf " "DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -4028,7 +3999,7 @@ bce_fw_sync_exit: /* Nothing. */ /****************************************************************************/ static void -bce_load_rv2p_fw(struct bce_softc *sc, u32 *rv2p_code, +bce_load_rv2p_fw(struct bce_softc *sc, const u32 *rv2p_code, u32 rv2p_code_len, u32 rv2p_proc) { int i; @@ -5244,24 +5215,28 @@ bce_blockinit(struct bce_softc *sc) REG_WR(sc, BCE_HC_STATISTICS_ADDR_H, BCE_ADDR_HI(sc->stats_block_paddr)); - /* Program various host coalescing parameters. */ + /* + * Program various host coalescing parameters. + * Trip points control how many BDs should be ready before generating + * an interrupt while ticks control how long a BD can sit in the chain + * before generating an interrupt. + */ REG_WR(sc, BCE_HC_TX_QUICK_CONS_TRIP, - (sc->bce_tx_quick_cons_trip_int << 16) | sc->bce_tx_quick_cons_trip); + (sc->bce_tx_quick_cons_trip_int << 16) | + sc->bce_tx_quick_cons_trip); REG_WR(sc, BCE_HC_RX_QUICK_CONS_TRIP, - (sc->bce_rx_quick_cons_trip_int << 16) | sc->bce_rx_quick_cons_trip); - REG_WR(sc, BCE_HC_COMP_PROD_TRIP, - (sc->bce_comp_prod_trip_int << 16) | sc->bce_comp_prod_trip); + (sc->bce_rx_quick_cons_trip_int << 16) | + sc->bce_rx_quick_cons_trip); REG_WR(sc, BCE_HC_TX_TICKS, (sc->bce_tx_ticks_int << 16) | sc->bce_tx_ticks); REG_WR(sc, BCE_HC_RX_TICKS, (sc->bce_rx_ticks_int << 16) | sc->bce_rx_ticks); - REG_WR(sc, BCE_HC_COM_TICKS, - (sc->bce_com_ticks_int << 16) | sc->bce_com_ticks); - REG_WR(sc, BCE_HC_CMD_TICKS, - (sc->bce_cmd_ticks_int << 16) | sc->bce_cmd_ticks); - REG_WR(sc, BCE_HC_STATS_TICKS, - (sc->bce_stats_ticks & 0xffff00)); + REG_WR(sc, BCE_HC_STATS_TICKS, sc->bce_stats_ticks & 0xffff00); REG_WR(sc, BCE_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ + /* Not used for L2. */ + REG_WR(sc, BCE_HC_COMP_PROD_TRIP, 0); + REG_WR(sc, BCE_HC_COM_TICKS, 0); + REG_WR(sc, BCE_HC_CMD_TICKS, 0); /* Configure the Host Coalescing block. */ val = BCE_HC_CONFIG_RX_TMR_MODE | BCE_HC_CONFIG_TX_TMR_MODE | @@ -5554,15 +5529,14 @@ bce_get_pg_buf(struct bce_softc *sc, str m_new->m_data = m_new->m_ext.ext_buf; } - m_new->m_len = sc->pg_bd_mbuf_alloc_size; + m_new->m_len = MCLBYTES; /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ map = sc->pg_mbuf_map[*prod_idx]; error = bus_dmamap_load(sc->pg_mbuf_tag, map, mtod(m_new, void *), - sc->pg_bd_mbuf_alloc_size, bce_dma_map_addr, - &busaddr, BUS_DMA_NOWAIT); + MCLBYTES, bce_dma_map_addr, &busaddr, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5586,7 +5560,7 @@ bce_get_pg_buf(struct bce_softc *sc, str pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(busaddr)); pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(busaddr)); - pgbd->rx_bd_len = htole32(sc->pg_bd_mbuf_alloc_size); + pgbd->rx_bd_len = htole32(MCLBYTES); pgbd->rx_bd_flags = htole32(RX_BD_FLAGS_START | RX_BD_FLAGS_END); /* Save the mbuf and update our counter. */ @@ -5974,10 +5948,9 @@ bce_free_rx_chain(struct bce_softc *sc) /* Clear each RX chain page. */ for (i = 0; i < sc->rx_pages; i++) - if (sc->rx_bd_chain[i] != NULL) { + if (sc->rx_bd_chain[i] != NULL) bzero((char *)sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - } sc->free_rx_bd = sc->max_rx_bd; @@ -6041,7 +6014,7 @@ bce_init_pg_chain(struct bce_softc *sc) CTX_WR(sc, GET_CID_ADDR(RX_CID), BCE_L2CTX_RX_PG_BUF_SIZE, 0); /* Configure the rx_bd and page chain mbuf cluster size. */ - val = (sc->rx_bd_mbuf_data_len << 16) | sc->pg_bd_mbuf_alloc_size; + val = (sc->rx_bd_mbuf_data_len << 16) | MCLBYTES; CTX_WR(sc, GET_CID_ADDR(RX_CID), BCE_L2CTX_RX_PG_BUF_SIZE, val); /* Configure the context reserved for jumbo support. */ @@ -7163,10 +7136,9 @@ bce_init_locked(struct bce_softc *sc) ether_mtu = ifp->if_mtu; else { if (bce_hdr_split == TRUE) { - if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + - sc->pg_bd_mbuf_alloc_size)) - ether_mtu = sc->rx_bd_mbuf_data_len + - sc->pg_bd_mbuf_alloc_size; + if (ifp->if_mtu <= sc->rx_bd_mbuf_data_len + MCLBYTES) + ether_mtu = sc->rx_bd_mbuf_data_len + + MCLBYTES; else ether_mtu = ifp->if_mtu; } else { @@ -7194,9 +7166,6 @@ bce_init_locked(struct bce_softc *sc) bce_set_rx_mode(sc); if (bce_hdr_split == TRUE) { - DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", - __FUNCTION__, sc->pg_bd_mbuf_alloc_size); - /* Init page buffer descriptor chain. */ bce_init_pg_chain(sc); } @@ -7690,7 +7659,6 @@ bce_start_locked(struct ifnet *ifp) bce_start_locked_exit: DBEXIT(BCE_VERBOSE_SEND | BCE_VERBOSE_CTX); - return; } @@ -8491,11 +8459,7 @@ bce_tick(void *xsc) /* Update the statistics from the hardware statistics block. */ bce_stats_update(sc); - /* - * ToDo: This is a safety measure. Need to re-evaluate - * high level processing logic and eliminate this code. - */ - /* Top off the receive and page chains. */ + /* Ensure page and RX chains get refilled in low-memory situations. */ if (bce_hdr_split == TRUE) bce_fill_pg_chain(sc); bce_fill_rx_chain(sc); @@ -8544,7 +8508,6 @@ bce_tick(void *xsc) bce_tick_exit: DBEXIT(BCE_EXTREME_MISC); - return; } static void @@ -11627,7 +11590,5 @@ bce_breakpoint(struct bce_softc *sc) /* Call the debugger. */ breakpoint(); - - return; } #endif Modified: head/sys/dev/bce/if_bcefw.h ============================================================================== --- head/sys/dev/bce/if_bcefw.h Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bcefw.h Thu May 30 16:09:56 2013 (r251142) @@ -57,7 +57,7 @@ u32 bce_COM_b06FwSbssAddr = 0x08004aa0; int bce_COM_b06FwSbssLen = 0x38; u32 bce_COM_b06FwSDataAddr = 0x00000000; int bce_COM_b06FwSDataLen = 0x0; -u32 bce_COM_b06FwText[(0x4a68/4) + 1] = { +const u32 bce_COM_b06FwText[(0x4a68/4) + 1] = { 0xa000046, 0x0, 0x0, 0xd, 0x636f6d36, 0x2e302e31, 0x35000000, 0x6000f02, 0x0, 0x3, 0xc8, @@ -1249,14 +1249,14 @@ u32 bce_COM_b06FwText[(0x4a68/4) + 1] = 0x440fffe, 0x24020002, 0xaf5101c0, 0xa34201c4, 0x3c021000, 0xaf4201f8, 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0020, 0x0 }; -u32 bce_COM_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwRodata[(0x14/4) + 1] = { +const u32 bce_COM_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwRodata[(0x14/4) + 1] = { 0x8000acc, 0x8000b14, 0x8000b98, 0x8000be4, 0x8000c20, 0x0 }; -u32 bce_COM_b06FwBss[(0xc4/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 }; -u32 bce_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwBss[(0xc4/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwSbss[(0x38/4) + 1] = { 0x0 }; +const u32 bce_COM_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_RXP_b06FwReleaseMajor = 0x6; @@ -1275,7 +1275,7 @@ u32 bce_RXP_b06FwSbssAddr = 0x08007320; int bce_RXP_b06FwSbssLen = 0x4c; u32 bce_RXP_b06FwSDataAddr = 0x00000000; int bce_RXP_b06FwSDataLen = 0x0; -u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = { +const u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = { 0xa000c84, 0x0, 0x0, 0xd, 0x72787036, 0x2e302e31, 0x35000000, 0x6000f03, 0x0, 0x1, 0x0, @@ -3114,15 +3114,15 @@ u32 bce_RXP_b06FwText[(0x72d0/4) + 1] = 0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3c021000, 0x27bd0028, 0x3e00008, 0xaf4201b8, 0x0 }; -u32 bce_RXP_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwRodata[(0x24/4) + 1] = { +const u32 bce_RXP_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwRodata[(0x24/4) + 1] = { 0x8003430, 0x8003430, 0x80033a8, 0x80033e0, 0x8003414, 0x8003438, 0x8003438, 0x8003438, 0x8003318, 0x0 }; -u32 bce_RXP_b06FwBss[(0x440/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwSbss[(0x4c/4) + 1] = { 0x0 }; -u32 bce_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwBss[(0x440/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwSbss[(0x4c/4) + 1] = { 0x0 }; +const u32 bce_RXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TPAT_b06FwReleaseMajor = 0x6; @@ -3141,7 +3141,7 @@ u32 bce_TPAT_b06FwSbssAddr = 0x08001c00; int bce_TPAT_b06FwSbssLen = 0x44; u32 bce_TPAT_b06FwSDataAddr = 0x00000000; int bce_TPAT_b06FwSDataLen = 0x0; -u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = { +const u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = { 0xa000124, 0x0, 0x0, 0xd, 0x74706136, 0x2e302e31, 0x35000000, 0x6000f01, 0x0, 0x0, 0x0, @@ -3524,11 +3524,11 @@ u32 bce_TPAT_b06FwText[(0x17d4/4) + 1] = 0x14a0fffb, 0x42042, 0xc35021, 0x8fbf0010, 0xa4c02, 0x312200ff, 0x27bd0018, 0xaf8a002c, 0x3e00008, 0xaf890030, 0x0 }; -u32 bce_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 }; -u32 bce_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwBss[(0x450/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwSbss[(0x44/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TXP_b06FwReleaseMajor = 0x6; @@ -3547,7 +3547,7 @@ u32 bce_TXP_b06FwSbssAddr = 0x08003c20; int bce_TXP_b06FwSbssLen = 0x68; u32 bce_TXP_b06FwSDataAddr = 0x00000000; int bce_TXP_b06FwSDataLen = 0x0; -u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = { +const u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = { 0xa00002a, 0x0, 0x0, 0xd, 0x74787036, 0x2e302e31, 0x35000000, 0x6000f00, 0x0, 0x136, 0xea60, @@ -4509,11 +4509,11 @@ u32 bce_TXP_b06FwText[(0x3bfc/4) + 1] = 0x3c010800, 0xac243d58, 0x3c010800, 0xac233d68, 0x3c010800, 0xac223d60, 0x3e00008, 0x0, 0x0 }; -u32 bce_TXP_b06FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwRodata[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwBss[(0x14c/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwSbss[(0x68/4) + 1] = { 0x0 }; -u32 bce_TXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwRodata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwBss[(0x14c/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwSbss[(0x68/4) + 1] = { 0x0 }; +const u32 bce_TXP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_CP_b06FwReleaseMajor = 0x6; @@ -4532,7 +4532,7 @@ u32 bce_CP_b06FwSbssAddr = 0x08005884; int bce_CP_b06FwSbssLen = 0xf1; u32 bce_CP_b06FwSDataAddr = 0x00000000; int bce_CP_b06FwSDataLen = 0x0; -u32 bce_CP_b06FwText[(0x5688/4) + 1] = { +const u32 bce_CP_b06FwText[(0x5688/4) + 1] = { 0xa000028, 0x0, 0x0, 0xd, 0x6370362e, 0x302e3135, 0x0, 0x6000f04, 0x0, 0x0, 0x0, @@ -5918,7 +5918,7 @@ u32 bce_CP_b06FwText[(0x5688/4) + 1] = { 0x27bd0030, 0x8f83001c, 0x8c620004, 0x10400003, 0x0, 0x3e00008, 0x0, 0x8c640010, 0x8c650008, 0xa001527, 0x8c66000c, 0x0 }; -u32 bce_CP_b06FwData[(0x84/4) + 1] = { +const u32 bce_CP_b06FwData[(0x84/4) + 1] = { 0x0, 0x1b, 0xf, 0xa, 0x8, 0x6, 0x5, 0x5, 0x4, 0x4, 0x3, @@ -5928,7 +5928,7 @@ u32 bce_CP_b06FwData[(0x84/4) + 1] = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x0 }; -u32 bce_CP_b06FwRodata[(0x158/4) + 1] = { +const u32 bce_CP_b06FwRodata[(0x158/4) + 1] = { 0x8000f24, 0x8000d6c, 0x8000fb8, 0x8001060, 0x8000f4c, 0x8000f8c, 0x8001194, 0x8000d88, 0x80011b8, 0x8000dd8, 0x8001554, @@ -5951,12 +5951,12 @@ u32 bce_CP_b06FwRodata[(0x158/4) + 1] = 0x8002e1c, 0x8002de4, 0x8002df0, 0x8002dfc, 0x8002e08, 0x80052e8, 0x80052a8, 0x8005274, 0x8005248, 0x8005224, 0x80051e0, 0x0 }; -u32 bce_CP_b06FwBss[(0x5d8/4) + 1] = { 0x0 }; -u32 bce_CP_b06FwSbss[(0xf1/4) + 1] = { 0x0 }; -u32 bce_CP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwBss[(0x5d8/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwSbss[(0xf1/4) + 1] = { 0x0 }; +const u32 bce_CP_b06FwSdata[(0x0/4) + 1] = { 0x0 }; -u32 bce_rv2p_proc1[] = { +const u32 bce_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x0106000f, 0x00000008, 0x0500ffff, @@ -6681,7 +6681,7 @@ u32 bce_TXP_b09FwSbssAddr = 0x08003d88; int bce_TXP_b09FwSbssLen = 0x64; u32 bce_TXP_b09FwSDataAddr = 0x00000000; int bce_TXP_b09FwSDataLen = 0x0; -u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = { +const u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = { 0xa00002a, 0x0, 0x0, 0xd, 0x74787036, 0x2e302e31, 0x37000000, 0x6001100, 0x0, 0x136, 0xea60, @@ -7661,15 +7661,15 @@ u32 bce_TXP_b09FwText[(0x3d28/4) + 1] = 0xac263fcc, 0x3c010800, 0xac253fc4, 0x3c010800, 0xac243fc0, 0x3c010800, 0xac233fd0, 0x3c010800, 0xac223fc8, 0x3e00008, 0x0, 0x0 }; -u32 bce_TXP_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwRodata[(0x30/4) + 1] = { +const u32 bce_TXP_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwRodata[(0x30/4) + 1] = { 0x80000940, 0x80000900, 0x80080100, 0x80080080, 0x80080000, 0x800e0000, 0x80080080, 0x80080000, 0x80000a80, 0x80000a00, 0x80000980, 0x80000900, 0x0 }; -u32 bce_TXP_b09FwBss[(0x24c/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwSbss[(0x64/4) + 1] = { 0x0 }; -u32 bce_TXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwBss[(0x24c/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwSbss[(0x64/4) + 1] = { 0x0 }; +const u32 bce_TXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_TPAT_b09FwReleaseMajor = 0x6; @@ -7688,7 +7688,7 @@ u32 bce_TPAT_b09FwSbssAddr = 0x08001720; int bce_TPAT_b09FwSbssLen = 0x3c; u32 bce_TPAT_b09FwSDataAddr = 0x00000000; int bce_TPAT_b09FwSDataLen = 0x0; -u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = { +const u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = { 0xa000124, 0x0, 0x0, 0xd, 0x74706136, 0x2e302e31, 0x37000000, 0x6001101, 0x0, 0x0, 0x0, @@ -7994,12 +7994,12 @@ u32 bce_TPAT_b09FwText[(0x12fc/4) + 1] = 0x0, 0x0, 0x2402ffff, 0x2463ffff, 0x1462fffa, 0x24840004, 0x3e00008, 0x0, 0x0 }; -u32 bce_TPAT_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwRodata[(0x4/4) + 1] = { +const u32 bce_TPAT_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwRodata[(0x4/4) + 1] = { 0x1, 0x0 }; -u32 bce_TPAT_b09FwBss[(0x12b4/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwSbss[(0x3c/4) + 1] = { 0x0 }; -u32 bce_TPAT_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwBss[(0x12b4/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwSbss[(0x3c/4) + 1] = { 0x0 }; +const u32 bce_TPAT_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_COM_b09FwReleaseMajor = 0x6; @@ -8018,7 +8018,7 @@ u32 bce_COM_b09FwSbssAddr = 0x08005608; int bce_COM_b09FwSbssLen = 0x30; u32 bce_COM_b09FwSDataAddr = 0x00000000; int bce_COM_b09FwSDataLen = 0x0; -u32 bce_COM_b09FwText[(0x5594/4) + 1] = { +const u32 bce_COM_b09FwText[(0x5594/4) + 1] = { 0xa000046, 0x0, 0x0, 0xd, 0x636f6d36, 0x2e302e31, 0x37000000, 0x6001102, 0x0, 0x3, 0xc8, @@ -9389,15 +9389,15 @@ u32 bce_COM_b09FwText[(0x5594/4) + 1] = 0x40f809, 0x0, 0xa001560, 0x0, 0xd, 0x3c1c0800, 0x279c5608, 0x8fbf0010, 0x3e00008, 0x27bd0018, 0x0 }; -u32 bce_COM_b09FwData[(0x0/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwRodata[(0x38/4) + 1] = { +const u32 bce_COM_b09FwData[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwRodata[(0x38/4) + 1] = { 0x80080240, 0x80080100, 0x80080080, 0x80080000, 0xc80, 0x3200, 0x8000e98, 0x8000ef4, 0x8000f88, 0x8001028, 0x8001074, 0x80080100, 0x80080080, 0x80080000, 0x0 }; -u32 bce_COM_b09FwBss[(0x11c/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwSbss[(0x30/4) + 1] = { 0x0 }; -u32 bce_COM_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwBss[(0x11c/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwSbss[(0x30/4) + 1] = { 0x0 }; +const u32 bce_COM_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_RXP_b09FwReleaseMajor = 0x6; @@ -9416,7 +9416,7 @@ u32 bce_RXP_b09FwSbssAddr = 0x08009400; int bce_RXP_b09FwSbssLen = 0x78; u32 bce_RXP_b09FwSDataAddr = 0x00000000; int bce_RXP_b09FwSDataLen = 0x0; -u32 bce_RXP_b09FwText[(0x9090/4) + 1] = { +const u32 bce_RXP_b09FwText[(0x9090/4) + 1] = { 0xa000c84, 0x0, 0x0, 0xd, 0x72787036, 0x2e302e31, 0x37000000, 0x6001103, 0x0, 0x1, 0x0, @@ -11786,9 +11786,9 @@ u32 bce_RXP_b09FwRodata[(0x33c/4) + 1] = 0x8007fc0, 0x8007fc0, 0x8007fc0, 0x8007fc0, 0x8007fe8, 0x8008b6c, 0x8008cc8, 0x8008ca8, 0x8008710, 0x8008b84, 0x0 }; -u32 bce_RXP_b09FwBss[(0x1bc/4) + 1] = { 0x0 }; -u32 bce_RXP_b09FwSbss[(0x78/4) + 1] = { 0x0 }; -u32 bce_RXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwBss[(0x1bc/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwSbss[(0x78/4) + 1] = { 0x0 }; +const u32 bce_RXP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; int bce_CP_b09FwReleaseMajor = 0x6; @@ -11807,7 +11807,7 @@ u32 bce_CP_b09FwSbssAddr = 0x080059b0; int bce_CP_b09FwSbssLen = 0xa8; u32 bce_CP_b09FwSDataAddr = 0x00000000; int bce_CP_b09FwSDataLen = 0x0; -u32 bce_CP_b09FwText[(0x5744/4) + 1] = { +const u32 bce_CP_b09FwText[(0x5744/4) + 1] = { 0xa000028, 0x0, 0x0, 0xd, 0x6370362e, 0x302e3137, 0x0, 0x6001104, 0x0, 0x0, 0x0, @@ -13205,7 +13205,7 @@ u32 bce_CP_b09FwText[(0x5744/4) + 1] = { 0xa00156a, 0x8fbf001c, 0xe0010d1, 0x0, 0x5040ff9e, 0x8fbf001c, 0x9259007d, 0x3330003f, 0xa0015c6, 0x36020040, 0x0 }; -u32 bce_CP_b09FwData[(0x84/4) + 1] = { +const u32 bce_CP_b09FwData[(0x84/4) + 1] = { 0x0, 0x1b, 0xf, 0xa, 0x8, 0x6, 0x5, 0x5, 0x4, 0x4, 0x3, @@ -13215,7 +13215,7 @@ u32 bce_CP_b09FwData[(0x84/4) + 1] = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x0 }; -u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = { +const u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = { 0x80080100, 0x80080080, 0x80080000, 0xc00, 0x3080, 0x80011d0, 0x800127c, 0x8001294, 0x80012a8, @@ -13245,12 +13245,12 @@ u32 bce_CP_b09FwRodata[(0x1c0/4) + 1] = 0x80080080, 0x80080000, 0x80080080, 0x8004c64, 0x8004c9c, 0x8004be4, 0x8004c64, 0x8004c64, 0x80049b8, 0x8004c64, 0x8005050, 0x0 }; -u32 bce_CP_b09FwBss[(0x19c/4) + 1] = { 0x0 }; -u32 bce_CP_b09FwSbss[(0xa8/4) + 1] = { 0x0 }; -u32 bce_CP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwBss[(0x19c/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwSbss[(0xa8/4) + 1] = { 0x0 }; +const u32 bce_CP_b09FwSdata[(0x0/4) + 1] = { 0x0 }; -u32 bce_xi_rv2p_proc1[] = { +const u32 bce_xi_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x05060011, 0x00000008, 0x0500ffff, @@ -13541,7 +13541,7 @@ u32 bce_xi_rv2p_proc1[] = { }; -u32 bce_xi_rv2p_proc2[] = { +const u32 bce_xi_rv2p_proc2[] = { 0x00000010, 0xb1800004, 0x0000001f, 0x05060011, 0x00000008, 0x050000ff, @@ -14008,9 +14008,9 @@ u32 bce_xi_rv2p_proc2[] = { 0x00000010, 0x001f0000, 0x00000018, 0x8000fe35, }; - -u32 bce_xi90_rv2p_proc1[] = { + +const u32 bce_xi90_rv2p_proc1[] = { 0x00000010, 0xb1800006, 0x0000001f, 0x03060011, 0x00000008, 0x0500ffff, @@ -14316,7 +14316,7 @@ u32 bce_xi90_rv2p_proc1[] = { }; -u32 bce_xi90_rv2p_proc2[] = { +const u32 bce_xi90_rv2p_proc2[] = { 0x00000010, 0xb1800004, 0x0000001f, 0x03060011, 0x00000008, 0x050000ff, @@ -14849,6 +14849,3 @@ u32 bce_xi90_rv2p_proc2[] = { bce_rv2p_proc2[BCE_RV2P_PROC2_MAX_BD_PAGE_LOC] = \ (bce_rv2p_proc2[BCE_RV2P_PROC2_MAX_BD_PAGE_LOC] & ~0xFFFF) | (value); \ } - - - Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Thu May 30 15:25:54 2013 (r251141) +++ head/sys/dev/bce/if_bcereg.h Thu May 30 16:09:56 2013 (r251142) @@ -32,10 +32,6 @@ #ifndef _BCEREG_H_DEFINED #define _BCEREG_H_DEFINED -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" -#endif - #include #include #include @@ -6336,13 +6332,13 @@ struct fw_info { u32 bss_addr; u32 bss_len; u32 bss_index; - u32 *bss; + const u32 *bss; /* Read-only section. */ u32 rodata_addr; u32 rodata_len; u32 rodata_index; - u32 *rodata; + const u32 *rodata; }; #define RV2P_PROC1 0 @@ -6421,6 +6417,8 @@ struct fw_info { struct bce_softc { + struct mtx bce_mtx; + /* Interface info */ struct ifnet *bce_ifp; @@ -6448,8 +6446,6 @@ struct bce_softc /* IRQ Resource Handle */ struct resource *bce_res_irq; - struct mtx bce_mtx; - /* Interrupt handler. */ void *bce_intrhand; @@ -6563,14 +6559,6 @@ struct bce_softc u16 bce_rx_ticks; u32 bce_stats_ticks; - /* ToDo: Can these be removed? */ - u16 bce_comp_prod_trip_int; - u16 bce_comp_prod_trip; - u16 bce_com_ticks_int; - u16 bce_com_ticks; - u16 bce_cmd_ticks_int; - u16 bce_cmd_ticks; - /* The address of the integrated PHY on the MII bus. */ int bce_phy_addr; @@ -6603,11 +6591,9 @@ struct bce_softc int watchdog_timer; /* Frame size and mbuf allocation size for RX frames. */ - u32 max_frame_size; int rx_bd_mbuf_alloc_size; int rx_bd_mbuf_data_len; int rx_bd_mbuf_align_pad; - int pg_bd_mbuf_alloc_size; /* Receive mode settings (i.e promiscuous, multicast, etc.). */ u32 rx_mode; From owner-svn-src-head@FreeBSD.ORG Thu May 30 16:16:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C96A3C40; Thu, 30 May 2013 16:16:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA7612AD; Thu, 30 May 2013 16:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UGGTtO054442; Thu, 30 May 2013 16:16:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UGGStA054435; Thu, 30 May 2013 16:16:28 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201305301616.r4UGGStA054435@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 30 May 2013 16:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251143 - in head/contrib/byacc: . package package/debian test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 16:16:29 -0000 Author: bapt Date: Thu May 30 16:16:28 2013 New Revision: 251143 URL: http://svnweb.freebsd.org/changeset/base/251143 Log: Update byacc to 20130304 Modified: head/contrib/byacc/CHANGES head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/config_h.in head/contrib/byacc/configure head/contrib/byacc/configure.in head/contrib/byacc/main.c head/contrib/byacc/makefile.in head/contrib/byacc/output.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/skeleton.c head/contrib/byacc/test/calc.tab.c head/contrib/byacc/test/calc1.tab.c head/contrib/byacc/test/calc1.y head/contrib/byacc/test/calc2.tab.c head/contrib/byacc/test/calc3.tab.c head/contrib/byacc/test/code_calc.code.c head/contrib/byacc/test/code_error.code.c head/contrib/byacc/test/error.tab.c head/contrib/byacc/test/ftp.output head/contrib/byacc/test/ftp.tab.c head/contrib/byacc/test/ftp.tab.h head/contrib/byacc/test/ftp.y head/contrib/byacc/test/grammar.tab.c head/contrib/byacc/test/pure_calc.tab.c head/contrib/byacc/test/pure_error.tab.c head/contrib/byacc/test/quote_calc-s.tab.c head/contrib/byacc/test/quote_calc.tab.c head/contrib/byacc/test/quote_calc2-s.tab.c head/contrib/byacc/test/quote_calc2.tab.c head/contrib/byacc/test/quote_calc3-s.tab.c head/contrib/byacc/test/quote_calc3.tab.c head/contrib/byacc/test/quote_calc4-s.tab.c head/contrib/byacc/test/quote_calc4.tab.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/CHANGES Thu May 30 16:16:28 2013 (r251143) @@ -1,3 +1,117 @@ +2013-03-04 Thomas E. Dickey + + * package/debian/changelog, VERSION, package/byacc.spec: bump + + * aclocal.m4: + adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf. + + * output.c: + fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton). + also while testing that, found a case where the union_file is unused; added + a check for address that. + + * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen + + * test/ftp.y: fix most compiler warnings for "make check_make" + + * test/calc1.tab.c: regen + + * test/calc1.y: fix most compiler warnings for "make check_make" + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: quiet a gcc conversion-warning in yygrowstack() + + * configure: regen + + * aclocal.m4: + another fix for CF_GCC_VERSION to handle Debian's modification of gcc message. + +2013-02-10 Thomas E. Dickey + + * config.sub, config.guess: 2013-02-04 + +2012-10-03 Thomas E. Dickey + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * configure: regen + + * configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC + + * aclocal.m4: + moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc) + the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor. + + * aclocal.m4, configure.in: + Arian's change dropped my check for misused $CC variable - restore that with + alternate macro CF_PROG_CC. + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since + they are not needed. + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in + Adrian's suggested changes. + + * aclocal.m4: + CF_CLANG_COMPILER - check if the given compiler is really clang. + + * aclocal.m4: + add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around + old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1 + on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's + pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work + around by excluding that check for pre-3.x compilers. + + * aclocal.m4: + modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions + provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather + than appending to confdefs.h, since long-ago concern about the ability to + pass-through parameterized macros appears to be not a problem, testing with + 2.13 and 2.52 + +2012-10-03 Adrian.Bunk + + * aclocal.m4: + add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by + autoheader, updated macros: + CF_CHECK_CACHE + CF_DISABLE_LEAKS + CF_MKSTEMP + CF_MIXEDCASE_FILENAMES + CF_NO_LEAKS_OPTION + +2012-10-03 Thomas E. Dickey + + * aclocal.m4: + move existence-check for mkstemp out of the AC_TRY_RUN, to help with + cross-compiles + +2012-10-02 Thomas E. Dickey + + * config_h.in: + Adrian Bunk request - replace this with the output from autoheader + +2012-09-29 Adrian.Bunk + + * configure.in: + suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no + check is needed anymore for standard C compilers), drop AC_CONST (same + reason), modify AC_OUTPUT to rely upon template generated by autoheader. + bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT + as being obsolete with autoconf 2.52x + + * configure.in, main.c: drop check for atexit, because it is standard C + + * makefile.in: add assignment for datarootdir variable. + 2012-05-26 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/VERSION Thu May 30 16:16:28 2013 (r251143) @@ -1 +1 @@ -20120526 +20130304 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/aclocal.m4 Thu May 30 16:16:28 2013 (r251143) @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.19 2012/01/13 14:10:56 tom Exp $ +dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2011,2012 Thomas E. Dickey +dnl Copyright 2004-2012,2013 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -28,6 +28,32 @@ dnl sale, use or other dealings in this dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl ------------------ +dnl Conditionally generate script according to whether we're using a given autoconf. +dnl +dnl $1 = version to compare against +dnl $2 = code to use if AC_ACVERSION is at least as high as $1. +dnl $3 = code to use if AC_ACVERSION is older than $1. +define([CF_ACVERSION_CHECK], +[ +ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([m4_version_compare], +[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], +[CF_ACVERSION_COMPARE( +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 +dnl -------------------- +dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, +dnl MAJOR2, MINOR2, TERNARY2, +dnl PRINTABLE2, not FOUND, FOUND) +define([CF_ACVERSION_COMPARE], +[ifelse(builtin([eval], [$2 < $5]), 1, +[ifelse([$8], , ,[$8])], +[ifelse([$9], , ,[$9])])])dnl +dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS @@ -116,97 +142,6 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45 -dnl ---------------- -dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and -dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution. -AC_DEFUN([CF_ANSI_CC_CHECK], -[ -# This should have been defined by AC_PROG_CC -: ${CC:=cc} - -# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content -# into CC. This will not help with broken scripts that wrap the compiler with -# options, but eliminates a more common category of user confusion. -AC_MSG_CHECKING(\$CC variable) -case "$CC" in #(vi -*[[\ \ ]]-[[IUD]]*) - AC_MSG_RESULT(broken) - AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) - # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` - CC=`echo "$CC" | sed -e 's/[[ ]].*//'` - CF_ADD_CFLAGS($cf_flags) - ;; -*) - AC_MSG_RESULT(ok) - ;; -esac - -AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do - CF_ADD_CFLAGS($cf_arg) - AC_TRY_COMPILE( -[ -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif -],[ - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);};], - [cf_cv_ansi_cc="$cf_arg"; break]) -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" -]) - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CF_ADD_CFLAGS($cf_cv_ansi_cc) -else - AC_DEFINE(CC_HAS_PROTOS) -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 -dnl --------------- -dnl For programs that must use an ANSI compiler, obtain compiler options that -dnl will make it recognize prototypes. We'll do preprocessor checks in other -dnl macros, since tools such as unproto can fake prototypes, but only part of -dnl the preprocessor. -AC_DEFUN([CF_ANSI_CC_REQD], -[AC_REQUIRE([CF_ANSI_CC_CHECK]) -if test "$cf_cv_ansi_cc" = "no"; then - AC_MSG_ERROR( -[Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto]) -fi -])dnl -dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. @@ -236,7 +171,33 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 +dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49 +dnl --------------- +dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content +dnl into CC. This will not help with broken scripts that wrap the compiler with +dnl options, but eliminates a more common category of user confusion. +AC_DEFUN([CF_CC_ENV_FLAGS], +[ +# This should have been defined by AC_PROG_CC +: ${CC:=cc} + +AC_MSG_CHECKING(\$CC variable) +case "$CC" in #(vi +*[[\ \ ]]-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + # humor him... + cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` + CC=`echo "$CC" | sed -e 's/[[ ]].*//'` + CF_ADD_CFLAGS($cf_flags) + ;; +*) + AC_MSG_RESULT(ok) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -259,7 +220,7 @@ else system_name="`(hostname) 2>/dev/null`" fi fi -test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" @@ -271,7 +232,40 @@ if test ".$system_name" != ".$cf_cv_syst fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57 +dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39 +dnl ----------------- +dnl Check if the given compiler is really clang. clang's C driver defines +dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does +dnl not ignore some gcc options. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_CLANG_COMPILER],[ +ifelse([$2],,CLANG_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) + cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" + ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" + AC_TRY_COMPILE([],[ +#ifdef __clang__ +#else +make an error +#endif +],[ifelse([$2],,CLANG_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. @@ -286,7 +280,7 @@ dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, - [ --disable-echo display "compiling" commands], + [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' @@ -308,7 +302,7 @@ AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 +dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -326,12 +320,12 @@ AC_ARG_ENABLE(leaks, AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then - AC_DEFINE(NO_LEAKS) - AC_DEFINE(YY_NO_LEAKS) + AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) + AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -409,27 +403,27 @@ EOF test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute) cat conftest.h >>confdefs.h case $cf_attribute in #(vi + noreturn) #(vi + AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) + ;; printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 +dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], - [AC_DEFINE($3)ifelse([$4],,[ + [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} @@ -858,29 +863,17 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 -dnl ----------- -dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. -AC_DEFUN([CF_PROG_EXT], -[ -AC_REQUIRE([CF_CHECK_CACHE]) -case $cf_cv_system_name in -os2*) - CFLAGS="$CFLAGS -Zmt" - CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt" - # autoconf's macro sets -Zexe and suffix both, which conflict:w - LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" - ac_cv_exeext=.exe - ;; -esac - -AC_EXEEXT -AC_OBJEXT - -PROG_EXT="$EXEEXT" -AC_SUBST(PROG_EXT) -test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") +dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl ---------- +dnl standard check for CC, plus followup sanity checks +dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name +AC_DEFUN([CF_PROG_CC],[ +ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) +CF_GCC_VERSION +CF_ACVERSION_CHECK(2.52, + [AC_PROG_CC_STDC], + [CF_ANSI_CC_REQD]) +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 @@ -1025,7 +1018,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49 +dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1035,6 +1028,7 @@ dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ +AC_REQUIRE([AC_CANONICAL_HOST]) cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Thu May 30 16:09:56 2013 (r251142) +++ head/contrib/byacc/config.guess Thu May 30 16:16:28 2013 (r251143) @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2911 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2011-01-01' +timestamp='2013-02-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,26 +15,22 @@ timestamp='2011-01-01' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +137,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -202,6 +194,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -220,10 +216,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) + *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac @@ -304,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -600,50 +596,50 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -792,21 +788,26 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,15 +862,22 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi @@ -877,30 +885,39 @@ EOF exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ - grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif @@ -937,7 +954,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -972,13 +989,13 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1096,7 +1113,7 @@ EOF && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1139,8 +1156,8 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) @@ -1168,9 +1185,9 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1185,6 +1202,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1215,12 +1235,12 @@ EOF i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi fi ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 30 17:24:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01670265; Thu, 30 May 2013 17:24:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E799383B; Thu, 30 May 2013 17:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UHOaJn078319; Thu, 30 May 2013 17:24:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UHOadW078318; Thu, 30 May 2013 17:24:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305301724.r4UHOadW078318@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 17:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251146 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 17:24:37 -0000 Author: marius Date: Thu May 30 17:24:36 2013 New Revision: 251146 URL: http://svnweb.freebsd.org/changeset/base/251146 Log: - Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are not altered or actually needed there any longer. - Honor errors passed to the DMA mapping callbacks. - In bce_get_rx_buf(), do not reserve stack space for more DMA segments than actually necessary. - In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9). - In bce_rx_intr(), remove a pointless check for an empty mbuf pointer which can only happen in case of a severe programming error. Moreover, recovering from that situation would require way more actions with header splitting enabled (which it is by default). - Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the firmware has been told to keep it. [1] Obtained from: OpenBSD [1] MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 17:17:22 2013 (r251145) +++ head/sys/dev/bce/if_bce.c Thu May 30 17:24:36 2013 (r251146) @@ -399,14 +399,12 @@ static int bce_blockinit (struct bce static int bce_init_tx_chain (struct bce_softc *); static void bce_free_tx_chain (struct bce_softc *); -static int bce_get_rx_buf (struct bce_softc *, - struct mbuf *, u16 *, u16 *, u32 *); +static int bce_get_rx_buf (struct bce_softc *, u16, u16, u32 *); static int bce_init_rx_chain (struct bce_softc *); static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -static int bce_get_pg_buf (struct bce_softc *, - struct mbuf *, u16 *, u16 *); +static int bce_get_pg_buf (struct bce_softc *, u16, u16); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); static void bce_free_pg_chain (struct bce_softc *); @@ -3544,7 +3542,7 @@ bce_dma_alloc(device_t dev) sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, &sc->status_block_paddr, BUS_DMA_NOWAIT); - if (error) { + if (error || sc->status_block_paddr == 0) { BCE_PRINTF("%s(%d): Could not map status block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3581,7 +3579,7 @@ bce_dma_alloc(device_t dev) sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, &sc->stats_block_paddr, BUS_DMA_NOWAIT); - if(error) { + if (error || sc->stats_block_paddr == 0) { BCE_PRINTF("%s(%d): Could not map statistics block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3633,7 +3631,7 @@ bce_dma_alloc(device_t dev) sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, &sc->ctx_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->ctx_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map CTX " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3678,7 +3676,7 @@ bce_dma_alloc(device_t dev) BCE_TX_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->tx_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->tx_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map TX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3755,7 +3753,7 @@ bce_dma_alloc(device_t dev) BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->rx_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->rx_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map RX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3832,7 +3830,7 @@ bce_dma_alloc(device_t dev) BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); - if (error) { + if (error || sc->pg_bd_chain_paddr[i] == 0) { BCE_PRINTF("%s(%d): Could not map page descriptor " "chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -5351,29 +5349,27 @@ bce_blockinit_exit: /* 0 for success, positive value for failure. */ /****************************************************************************/ static int -bce_get_rx_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, - u16 *chain_prod, u32 *prod_bseq) +bce_get_rx_buf(struct bce_softc *sc, u16 prod, u16 chain_prod, u32 *prod_bseq) { - bus_dmamap_t map; - bus_dma_segment_t segs[BCE_MAX_SEGMENTS]; + bus_dma_segment_t segs[1]; struct mbuf *m_new = NULL; struct rx_bd *rxbd; int nsegs, error, rc = 0; #ifdef BCE_DEBUG - u16 debug_chain_prod = *chain_prod; + u16 debug_chain_prod = chain_prod; #endif DBENTER(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); /* Make sure the inputs are valid. */ - DBRUNIF((*chain_prod > MAX_RX_BD_ALLOC), + DBRUNIF((chain_prod > MAX_RX_BD_ALLOC), BCE_PRINTF("%s(%d): RX producer out of range: " "0x%04X > 0x%04X\n", __FILE__, __LINE__, - *chain_prod, (u16) MAX_RX_BD_ALLOC)); + chain_prod, (u16)MAX_RX_BD_ALLOC)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(enter): prod = 0x%04X, " "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", __FUNCTION__, - *prod, *chain_prod, *prod_bseq); + prod, chain_prod, *prod_bseq); /* Update some debug statistic counters */ DBRUNIF((sc->free_rx_bd < sc->rx_low_watermark), @@ -5381,35 +5377,28 @@ bce_get_rx_buf(struct bce_softc *sc, str DBRUNIF((sc->free_rx_bd == sc->max_rx_bd), sc->rx_empty_count++); - /* Check whether this is a new mbuf allocation. */ - if (m == NULL) { + /* Simulate an mbuf allocation failure. */ + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; + rc = ENOBUFS; + goto bce_get_rx_buf_exit); - /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), - sc->mbuf_alloc_failed_count++; - sc->mbuf_alloc_failed_sim_count++; - rc = ENOBUFS; - goto bce_get_rx_buf_exit); - - /* This is a new mbuf allocation. */ - if (bce_hdr_split == TRUE) - MGETHDR(m_new, M_NOWAIT, MT_DATA); - else - m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, - sc->rx_bd_mbuf_alloc_size); - - if (m_new == NULL) { - sc->mbuf_alloc_failed_count++; - rc = ENOBUFS; - goto bce_get_rx_buf_exit; - } + /* This is a new mbuf allocation. */ + if (bce_hdr_split == TRUE) + MGETHDR(m_new, M_NOWAIT, MT_DATA); + else + m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + sc->rx_bd_mbuf_alloc_size); - DBRUN(sc->debug_rx_mbuf_alloc++); - } else { - /* Reuse an existing mbuf. */ - m_new = m; + if (m_new == NULL) { + sc->mbuf_alloc_failed_count++; + rc = ENOBUFS; + goto bce_get_rx_buf_exit; } + DBRUN(sc->debug_rx_mbuf_alloc++); + /* Make sure we have a valid packet header. */ M_ASSERTPKTHDR(m_new); @@ -5420,9 +5409,8 @@ bce_get_rx_buf(struct bce_softc *sc, str /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ - map = sc->rx_mbuf_map[*chain_prod]; - error = bus_dmamap_load_mbuf_sg(sc->rx_mbuf_tag, map, m_new, - segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->rx_mbuf_tag, + sc->rx_mbuf_map[chain_prod], m_new, segs, &nsegs, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5443,7 +5431,7 @@ bce_get_rx_buf(struct bce_softc *sc, str __FUNCTION__, nsegs)); /* Setup the rx_bd for the segment. */ - rxbd = &sc->rx_bd_chain[RX_PAGE(*chain_prod)][RX_IDX(*chain_prod)]; + rxbd = &sc->rx_bd_chain[RX_PAGE(chain_prod)][RX_IDX(chain_prod)]; rxbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[0].ds_addr)); rxbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[0].ds_addr)); @@ -5452,15 +5440,15 @@ bce_get_rx_buf(struct bce_softc *sc, str *prod_bseq += segs[0].ds_len; /* Save the mbuf and update our counter. */ - sc->rx_mbuf_ptr[*chain_prod] = m_new; + sc->rx_mbuf_ptr[chain_prod] = m_new; sc->free_rx_bd -= nsegs; DBRUNMSG(BCE_INSANE_RECV, bce_dump_rx_mbuf_chain(sc, debug_chain_prod, nsegs)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(exit): prod = 0x%04X, " - "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", - __FUNCTION__, *prod, *chain_prod, *prod_bseq); + "chain_prod = 0x%04X, prod_bseq = 0x%08X\n", __FUNCTION__, prod, + chain_prod, *prod_bseq); bce_get_rx_buf_exit: DBEXIT(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); @@ -5476,67 +5464,56 @@ bce_get_rx_buf_exit: /* 0 for success, positive value for failure. */ /****************************************************************************/ static int -bce_get_pg_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, - u16 *prod_idx) +bce_get_pg_buf(struct bce_softc *sc, u16 prod, u16 prod_idx) { - bus_dmamap_t map; - bus_addr_t busaddr; + bus_dma_segment_t segs[1]; struct mbuf *m_new = NULL; struct rx_bd *pgbd; - int error, rc = 0; + int error, nsegs, rc = 0; #ifdef BCE_DEBUG - u16 debug_prod_idx = *prod_idx; + u16 debug_prod_idx = prod_idx; #endif DBENTER(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); /* Make sure the inputs are valid. */ - DBRUNIF((*prod_idx > MAX_PG_BD_ALLOC), + DBRUNIF((prod_idx > MAX_PG_BD_ALLOC), BCE_PRINTF("%s(%d): page producer out of range: " "0x%04X > 0x%04X\n", __FILE__, __LINE__, - *prod_idx, (u16) MAX_PG_BD_ALLOC)); + prod_idx, (u16)MAX_PG_BD_ALLOC)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(enter): prod = 0x%04X, " - "chain_prod = 0x%04X\n", __FUNCTION__, *prod, *prod_idx); + "chain_prod = 0x%04X\n", __FUNCTION__, prod, prod_idx); /* Update counters if we've hit a new low or run out of pages. */ DBRUNIF((sc->free_pg_bd < sc->pg_low_watermark), sc->pg_low_watermark = sc->free_pg_bd); DBRUNIF((sc->free_pg_bd == sc->max_pg_bd), sc->pg_empty_count++); - /* Check whether this is a new mbuf allocation. */ - if (m == NULL) { - - /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), - sc->mbuf_alloc_failed_count++; - sc->mbuf_alloc_failed_sim_count++; - rc = ENOBUFS; - goto bce_get_pg_buf_exit); - - /* This is a new mbuf allocation. */ - m_new = m_getcl(M_NOWAIT, MT_DATA, 0); - if (m_new == NULL) { - sc->mbuf_alloc_failed_count++; - rc = ENOBUFS; - goto bce_get_pg_buf_exit; - } - - DBRUN(sc->debug_pg_mbuf_alloc++); - } else { - /* Reuse an existing mbuf. */ - m_new = m; - m_new->m_data = m_new->m_ext.ext_buf; + /* Simulate an mbuf allocation failure. */ + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; + rc = ENOBUFS; + goto bce_get_pg_buf_exit); + + /* This is a new mbuf allocation. */ + m_new = m_getcl(M_NOWAIT, MT_DATA, 0); + if (m_new == NULL) { + sc->mbuf_alloc_failed_count++; + rc = ENOBUFS; + goto bce_get_pg_buf_exit; } + DBRUN(sc->debug_pg_mbuf_alloc++); + m_new->m_len = MCLBYTES; /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ - map = sc->pg_mbuf_map[*prod_idx]; - error = bus_dmamap_load(sc->pg_mbuf_tag, map, mtod(m_new, void *), - MCLBYTES, bce_dma_map_addr, &busaddr, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->pg_mbuf_tag, + sc->pg_mbuf_map[prod_idx], m_new, segs, &nsegs, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ if (error) { @@ -5550,28 +5527,32 @@ bce_get_pg_buf(struct bce_softc *sc, str goto bce_get_pg_buf_exit; } + /* All mbufs must map to a single segment. */ + KASSERT(nsegs == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nsegs)); + /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREREAD) here? */ /* * The page chain uses the same rx_bd data structure * as the receive chain but doesn't require a byte sequence (bseq). */ - pgbd = &sc->pg_bd_chain[PG_PAGE(*prod_idx)][PG_IDX(*prod_idx)]; + pgbd = &sc->pg_bd_chain[PG_PAGE(prod_idx)][PG_IDX(prod_idx)]; - pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(busaddr)); - pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(busaddr)); + pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[0].ds_addr)); + pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[0].ds_addr)); pgbd->rx_bd_len = htole32(MCLBYTES); pgbd->rx_bd_flags = htole32(RX_BD_FLAGS_START | RX_BD_FLAGS_END); /* Save the mbuf and update our counter. */ - sc->pg_mbuf_ptr[*prod_idx] = m_new; + sc->pg_mbuf_ptr[prod_idx] = m_new; sc->free_pg_bd--; DBRUNMSG(BCE_INSANE_RECV, bce_dump_pg_mbuf_chain(sc, debug_prod_idx, 1)); DBPRINT(sc, BCE_EXTREME_RECV, "%s(exit): prod = 0x%04X, " - "prod_idx = 0x%04X\n", __FUNCTION__, *prod, *prod_idx); + "prod_idx = 0x%04X\n", __FUNCTION__, prod, prod_idx); bce_get_pg_buf_exit: DBEXIT(BCE_EXTREME_RESET | BCE_EXTREME_RECV | BCE_EXTREME_LOAD); @@ -5893,7 +5874,7 @@ bce_fill_rx_chain(struct bce_softc *sc) /* Keep filling the RX chain until it's full. */ while (sc->free_rx_bd > 0) { prod_idx = RX_CHAIN_IDX(prod); - if (bce_get_rx_buf(sc, NULL, &prod, &prod_idx, &prod_bseq)) { + if (bce_get_rx_buf(sc, prod, prod_idx, &prod_bseq)) { /* Bail out if we can't add an mbuf to the chain. */ break; } @@ -5907,13 +5888,11 @@ bce_fill_rx_chain(struct bce_softc *sc) /* We should never end up pointing to a next page pointer. */ DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE), BCE_PRINTF("%s(): Invalid rx_prod value: 0x%04X\n", - __FUNCTION__, sc->rx_prod)); + __FUNCTION__, rx_prod)); /* Write the mailbox and tell the chip about the waiting rx_bd's. */ - REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_BDIDX, sc->rx_prod); - REG_WR(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_BSEQ, sc->rx_prod_bseq); + REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_BDIDX, prod); + REG_WR(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_BSEQ, prod_bseq); DBEXIT(BCE_VERBOSE_RESET | BCE_EXTREME_RECV | BCE_VERBOSE_LOAD | BCE_VERBOSE_CTX); @@ -6064,7 +6043,7 @@ bce_fill_pg_chain(struct bce_softc *sc) /* Keep filling the page chain until it's full. */ while (sc->free_pg_bd > 0) { prod_idx = PG_CHAIN_IDX(prod); - if (bce_get_pg_buf(sc, NULL, &prod, &prod_idx)) { + if (bce_get_pg_buf(sc, prod, prod_idx)) { /* Bail out if we can't add an mbuf to the chain. */ break; } @@ -6076,14 +6055,14 @@ bce_fill_pg_chain(struct bce_softc *sc) DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE), BCE_PRINTF("%s(): Invalid pg_prod value: 0x%04X\n", - __FUNCTION__, sc->pg_prod)); + __FUNCTION__, pg_prod)); /* * Write the mailbox and tell the chip about * the new rx_bd's in the page chain. */ - REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + - BCE_L2MQ_RX_HOST_PG_BDIDX, sc->pg_prod); + REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_PG_BDIDX, + prod); DBEXIT(BCE_VERBOSE_RESET | BCE_EXTREME_RECV | BCE_VERBOSE_LOAD | BCE_VERBOSE_CTX); @@ -6598,14 +6577,6 @@ bce_rx_intr(struct bce_softc *sc) DBRUN(sc->debug_rx_mbuf_alloc--); sc->free_rx_bd++; - if(m0 == NULL) { - DBPRINT(sc, BCE_EXTREME_RECV, - "%s(): Oops! Empty mbuf pointer " - "found in sc->rx_mbuf_ptr[0x%04X]!\n", - __FUNCTION__, sw_rx_cons_idx); - goto bce_rx_int_next_rx; - } - /* * Frames received on the NetXteme II are prepended * with an l2_fhdr structure which provides status @@ -6764,7 +6735,7 @@ bce_rx_intr(struct bce_softc *sc) m_freem(m0); m0 = NULL; - goto bce_rx_int_next_rx; + goto bce_rx_intr_next_rx; } /* Send the packet to the appropriate interface. */ @@ -6775,7 +6746,6 @@ bce_rx_intr(struct bce_softc *sc) /* Validate the checksum if offload enabled. */ if (ifp->if_capenable & IFCAP_RXCSUM) { - /* Check for an IP datagram. */ if (!(status & L2_FHDR_STATUS_SPLIT) && (status & L2_FHDR_STATUS_IP_DATAGRAM)) { @@ -6805,7 +6775,8 @@ bce_rx_intr(struct bce_softc *sc) } /* Attach the VLAN tag. */ - if (status & L2_FHDR_STATUS_L2_VLAN_TAG) { + if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && + !(sc->rx_mode & BCE_EMAC_RX_MODE_KEEP_VLAN_TAG)) { DBRUN(sc->vlan_tagged_frames_rcvd++); if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { DBRUN(sc->vlan_tagged_frames_stripped++); @@ -6844,7 +6815,7 @@ bce_rx_intr(struct bce_softc *sc) /* Increment received packet statistics. */ ifp->if_ipackets++; -bce_rx_int_next_rx: +bce_rx_intr_next_rx: sw_rx_cons = NEXT_RX_BD(sw_rx_cons); /* If we have a packet, pass it up the stack */ @@ -8094,8 +8065,9 @@ bce_set_rx_mode(struct bce_softc *sc) /* Enable all multicast addresses. */ for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) { - REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), 0xffffffff); - } + REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), + 0xffffffff); + } sort_mode |= BCE_RPM_SORT_USER0_MC_EN; } else { /* Accept one or more multicast(s). */ From owner-svn-src-head@FreeBSD.ORG Thu May 30 19:51:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8053E1DA; Thu, 30 May 2013 19:51:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7187F196; Thu, 30 May 2013 19:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJpYhF030671; Thu, 30 May 2013 19:51:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJpY2l030670; Thu, 30 May 2013 19:51:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305301951.r4UJpY2l030670@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 19:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251149 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 19:51:34 -0000 Author: kib Date: Thu May 30 19:51:33 2013 New Revision: 251149 URL: http://svnweb.freebsd.org/changeset/base/251149 Log: Assert that OBJ_TMPFS flag on the vm object for the tmpfs node is cleared when the tmpfs node is going away. Tested by: bdrewery, pho Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu May 30 19:24:29 2013 (r251148) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu May 30 19:51:33 2013 (r251149) @@ -314,6 +314,8 @@ tmpfs_free_node(struct tmpfs_mount *tmp, TMPFS_LOCK(tmp); tmp->tm_pages_used -= uobj->size; TMPFS_UNLOCK(tmp); + KASSERT((uobj->flags & OBJ_TMPFS) == 0, + ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); vm_object_deallocate(uobj); } break; From owner-svn-src-head@FreeBSD.ORG Thu May 30 19:53:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B50F7449; Thu, 30 May 2013 19:53:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A7BD91AA; Thu, 30 May 2013 19:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJrVoo031124; Thu, 30 May 2013 19:53:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJrVf5031123; Thu, 30 May 2013 19:53:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305301953.r4UJrVf5031123@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 19:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251150 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 19:53:31 -0000 Author: kib Date: Thu May 30 19:53:31 2013 New Revision: 251150 URL: http://svnweb.freebsd.org/changeset/base/251150 Log: Remove the capitalization in the assertion message. Print the address of the object to get useful information from optimizated kernels dump. Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 30 19:51:33 2013 (r251149) +++ head/sys/vm/vm_object.c Thu May 30 19:53:31 2013 (r251150) @@ -557,7 +557,7 @@ vm_object_deallocate(vm_object_t object) (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { KASSERT((object->flags & OBJ_TMPFS) == 0, - ("Shadowed tmpfs v_object")); + ("shadowed tmpfs v_object %p", object)); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); From owner-svn-src-head@FreeBSD.ORG Thu May 30 20:00:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57F85751; Thu, 30 May 2013 20:00:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE70217; Thu, 30 May 2013 20:00:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UK0KIE032723; Thu, 30 May 2013 20:00:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UK0KYp032722; Thu, 30 May 2013 20:00:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305302000.r4UK0KYp032722@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 May 2013 20:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251151 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 20:00:20 -0000 Author: kib Date: Thu May 30 20:00:19 2013 New Revision: 251151 URL: http://svnweb.freebsd.org/changeset/base/251151 Log: After the object lock was dropped, the object' reference count could change. Retest the ref_count and return from the function to not execute the further code which assumes that ref_count == 1 if it is not. Also, do not leak vnode lock if other thread cleared OBJ_TMPFS flag meantime. Reported by: bdrewery Tested by: bdrewery, pho Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 30 19:53:31 2013 (r251150) +++ head/sys/vm/vm_object.c Thu May 30 20:00:19 2013 (r251151) @@ -536,15 +536,15 @@ vm_object_deallocate(vm_object_t object) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vdrop(vp); VM_OBJECT_WLOCK(object); - if (object->type == OBJT_DEAD) { + if (object->type == OBJT_DEAD || + object->ref_count != 1) { VM_OBJECT_WUNLOCK(object); VOP_UNLOCK(vp, 0); return; - } else if ((object->flags & OBJ_TMPFS) != 0) { - if (object->ref_count == 1) - VOP_UNSET_TEXT(vp); - VOP_UNLOCK(vp, 0); } + if ((object->flags & OBJ_TMPFS) != 0) + VOP_UNSET_TEXT(vp); + VOP_UNLOCK(vp, 0); } if (object->shadow_count == 0 && object->handle == NULL && From owner-svn-src-head@FreeBSD.ORG Thu May 30 20:51:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 34E27D27; Thu, 30 May 2013 20:51:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 176557C4; Thu, 30 May 2013 20:51:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKpOoN052188; Thu, 30 May 2013 20:51:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKpM6p052173; Thu, 30 May 2013 20:51:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302051.r4UKpM6p052173@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251158 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 20:51:24 -0000 Author: delphij Date: Thu May 30 20:51:22 2013 New Revision: 251158 URL: http://svnweb.freebsd.org/changeset/base/251158 Log: MFV: tcpdump 4.4.0. MFC after: 4 weeks Added: head/contrib/tcpdump/print-msnlb.c - copied unchanged from r251129, vendor/tcpdump/dist/print-msnlb.c head/contrib/tcpdump/print-otv.c - copied, changed from r251129, vendor/tcpdump/dist/print-otv.c head/contrib/tcpdump/print-vxlan.c - copied, changed from r251129, vendor/tcpdump/dist/print-vxlan.c head/contrib/tcpdump/print-zeromq.c - copied unchanged from r251129, vendor/tcpdump/dist/print-zeromq.c Modified: head/contrib/tcpdump/CHANGES head/contrib/tcpdump/CREDITS head/contrib/tcpdump/Makefile.in head/contrib/tcpdump/README head/contrib/tcpdump/VERSION head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/checksum.c head/contrib/tcpdump/configure head/contrib/tcpdump/configure.in head/contrib/tcpdump/ethertype.h head/contrib/tcpdump/icmp6.h head/contrib/tcpdump/interface.h head/contrib/tcpdump/netdissect.h head/contrib/tcpdump/nlpid.c head/contrib/tcpdump/nlpid.h head/contrib/tcpdump/print-802_11.c head/contrib/tcpdump/print-babel.c head/contrib/tcpdump/print-bgp.c head/contrib/tcpdump/print-dhcp6.c head/contrib/tcpdump/print-domain.c head/contrib/tcpdump/print-ether.c head/contrib/tcpdump/print-icmp6.c head/contrib/tcpdump/print-isoclns.c head/contrib/tcpdump/print-lldp.c head/contrib/tcpdump/print-ntp.c head/contrib/tcpdump/print-pppoe.c head/contrib/tcpdump/print-rip.c head/contrib/tcpdump/print-rpki-rtr.c head/contrib/tcpdump/print-stp.c head/contrib/tcpdump/print-tcp.c head/contrib/tcpdump/print-udp.c head/contrib/tcpdump/tcp.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 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/CHANGES Thu May 30 20:51:22 2013 (r251158) @@ -1,3 +1,37 @@ +Thursday February 19, 2013 guy@alum.mit.edu. + Summary for 4.4.0 tcpdump release + RPKI-RTR (RFC6810) is now official (TCP Port 323) + Fix detection of OpenSSL libcrypto. + Add DNSSL (RFC6106) support. + Add "radius" as an option for -T. + Update Action codes for handle_action function according to + 802.11s amendment. + Decode DHCPv6 AFTR-Name option (RFC6334). + Updates for Babel. + Fix printing of infinite lifetime in ICMPv6. + Added support for SPB, SPBM Service Identifier, and Unicast + Address sub-TLV in ISIS. + Decode RIPv2 authentication up to RFC4822. + Fix RIP Request/full table decoding issues. + On Linux systems with cap-ng.h, drop root privileges + using Linux Capabilities. + Add support for reading multiple files. + +Wednesday November 28, 2012 guy@alum.mit.edu. + Summary for 4.3.1 tcpdump release + Print "LLDP, length N" for LLDP packets even when not in verbose + mode, so something is printed even if only the timestamp is + present + Document "-T carp" + Print NTP poll interval correctly (it's an exponent, so print + both its raw value and 2^value) + Document that "-e" is used to get MAC addresses + More clearly document that you need to escape or quote + backslashes in filter expressions on the command line + Fix some "the the" in the man page + Use the right maximum path length + Don't treat 192_1_2, when passed to -i, as an interface number + Friday April 3, 2011. mcr@sandelman.ca. Summary for 4.3.0 tcpdump release fixes for forces: SPARSE data (per RFC 5810) Modified: head/contrib/tcpdump/CREDITS ============================================================================== --- head/contrib/tcpdump/CREDITS Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/CREDITS Thu May 30 20:51:22 2013 (r251158) @@ -52,6 +52,7 @@ Additional people who have contributed p David Horn David Smith David Young + Denis Ovsienko Dmitry Eremin-Solenikov Don Ebright Eddie Kohler Modified: head/contrib/tcpdump/Makefile.in ============================================================================== --- head/contrib/tcpdump/Makefile.in Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/Makefile.in Thu May 30 20:51:22 2013 (r251158) @@ -84,7 +84,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ 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-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.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 \ @@ -93,7 +93,7 @@ CSRC = addrtoname.c af.c checksum.c cpac print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \ print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \ - print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c + print-wb.c print-zephyr.c print-zeromq.c print-vxlan.c print-otv.c signature.c setsignal.c tcpdump.c util.c LIBNETDISSECT_SRC=print-isakmp.c LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) @@ -263,93 +263,8 @@ EXTRA_DIST = \ stime.awk \ strcasecmp.c \ tcpdump.1.in \ - 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 \ - tests/chdlc-slarp-short.pcap \ - tests/chdlc-slarp.pcap \ - tests/dio.out \ - tests/dio.pcap \ - tests/e1000g.out \ - tests/e1000g.pcap \ - tests/eapon1.gdbinit \ - tests/eapon1.out \ - tests/eapon1.pcap \ - tests/empty.uu \ - tests/esp-secrets.txt \ - tests/esp0.out \ - tests/esp1.gdbinit \ - tests/esp1.out \ - tests/esp2.gdbinit \ - tests/esp2.out \ - tests/esp3.gdbinit \ - tests/esp4.gdbinit \ - tests/esp5.gdbinit \ - tests/esp5.out \ - tests/espudp1.out \ - tests/espudp1.pcap \ - tests/forces1.out \ - tests/forces1.pcap \ - tests/forces1vvv.out \ - tests/forces1vvvv.out \ - tests/forces2v.out \ - tests/forces2vv.out \ - tests/forces3vvv.out \ - tests/icmpv6.out \ - tests/icmpv6.pcap \ - tests/ikev2four.out \ - tests/ikev2four.pcap \ - tests/ikev2fourv.out \ - tests/ikev2fourv4.out \ - tests/ikev2pI2-secrets.txt \ - tests/ikev2pI2.out \ - 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.pcap \ - tests/isis-infinite-loop.pcap \ - tests/ldp-infinite-loop.pcap \ - tests/lmp.out \ - 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.pcap \ - tests/mpls-traceroute.pcap \ - tests/ospf-gmpls.out \ - tests/ospf-gmpls.pcap \ - tests/pppoe.out \ - tests/pppoe.pcap \ - tests/print-A.out \ - tests/print-AA.out \ - tests/print-capX.out \ - tests/print-capXX.out \ - 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/bittypes.h \ win32/Include/errno.h \ win32/Include/getopt.h \ win32/Include/w32_fzs.h \ @@ -358,6 +273,8 @@ EXTRA_DIST = \ win32/prj/WinDump.dsp \ win32/prj/WinDump.dsw +TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` + all: $(PROG) $(PROG): $(OBJ) @V_PCAPDEP@ @@ -443,9 +360,12 @@ TAGS: $(TAGFILES) releasetar: @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ mkdir $$name; \ - tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \ + tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \ tar -c -z -f $$name.tar.gz $$name; \ rm -rf $$name +testlist: + echo $(TEST_DIST) + depend: $(GENSRC) ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) Modified: head/contrib/tcpdump/README ============================================================================== --- head/contrib/tcpdump/README Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/README Thu May 30 20:51:22 2013 (r251158) @@ -13,8 +13,11 @@ Anonymous Git is available via: Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely": cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump -Please submit patches against the master copy to the tcpdump project on -sourceforge.net. +Please submit patches by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. formerly from Lawrence Berkeley National Laboratory Network Research Group @@ -68,16 +71,19 @@ documentation. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the SourceForge -site for tcpdump at +requests, and feature requests may also be submitted on the GitHub issue +tracker for tcpdump at - http://sourceforge.net/projects/tcpdump/ + https://github.com/mcr/tcpdump/issues Source code contributions, etc. should be sent to the email address -submitted as patches on the SourceForge site for tcpdump. +above or submitted by forking the branch on GitHub at + + http://github.com/mcr/tcpdump/tree/master + +and issuing a pull request. -Current versions can be found at www.tcpdump.org, or the SourceForge -site for tcpdump. +Current versions can be found at www.tcpdump.org. - The TCPdump team Modified: head/contrib/tcpdump/VERSION ============================================================================== --- head/contrib/tcpdump/VERSION Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/VERSION Thu May 30 20:51:22 2013 (r251158) @@ -1 +1 @@ -4.3.0 +4.4.0 Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/addrtoname.c Thu May 30 20:51:22 2013 (r251158) @@ -383,6 +383,9 @@ lookup_bytestring(register const u_char tp->e_addr2 = k; tp->e_bs = (u_char *) calloc(1, nlen + 1); + if (tp->e_bs == NULL) + error("lookup_bytestring: calloc"); + memcpy(tp->e_bs, bs, nlen); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) Modified: head/contrib/tcpdump/checksum.c ============================================================================== --- head/contrib/tcpdump/checksum.c Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/checksum.c Thu May 30 20:51:22 2013 (r251158) @@ -152,8 +152,6 @@ create_osi_cksum (const u_int8_t *pptr, u_int16_t checksum; int index; - checksum = 0; - c0 = 0; c1 = 0; Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Thu May 30 20:46:56 2013 (r251157) +++ head/contrib/tcpdump/configure Thu May 30 20:51:22 2013 (r251158) @@ -1,61 +1,84 @@ #! /bin/sh # From configure.in Revision: 1.204 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.68. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -64,20 +87,19 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -88,354 +110,328 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -fi -fi +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 30 20:54:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48756F13; Thu, 30 May 2013 20:54:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3ABBF7FD; Thu, 30 May 2013 20:54:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKsIOh052721; Thu, 30 May 2013 20:54:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKsIQX052720; Thu, 30 May 2013 20:54:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305302054.r4UKsIQX052720@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 May 2013 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251159 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 20:54:18 -0000 Author: marius Date: Thu May 30 20:54:17 2013 New Revision: 251159 URL: http://svnweb.freebsd.org/changeset/base/251159 Log: - Checking for spurious interrupts is only necessary when using INTx. Actually, this may be further optimized for controller variants supporting one-shot MSIs but I'm lacking the necessary hardware for testing. - Add some missing synchronization of the statistics and status DMA maps. MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 30 20:51:22 2013 (r251158) +++ head/sys/dev/bce/if_bce.c Thu May 30 20:54:17 2013 (r251159) @@ -7876,7 +7876,7 @@ bce_watchdog_exit: /* interrupt causes (PHY, TX, RX). */ /* */ /* Returns: */ -/* 0 for success, positive value for failure. */ +/* Nothing. */ /****************************************************************************/ static void bce_intr(void *xsc) @@ -7898,16 +7898,16 @@ bce_intr(void *xsc) DBRUN(sc->interrupts_generated++); /* Synchnorize before we read from interface's status block */ - bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_POSTREAD); /* - * If the hardware status block index - * matches the last value read by the - * driver and we haven't asserted our - * interrupt then there's nothing to do. + * If the hardware status block index matches the last value read + * by the driver and we haven't asserted our interrupt then there's + * nothing to do. This may only happen in case of INTx due to the + * interrupt arriving at the CPU before the status block is updated. */ - if ((sc->status_block->status_idx == sc->last_status_idx) && + if ((sc->bce_flags & (BCE_USING_MSI_FLAG | BCE_USING_MSIX_FLAG)) == 0 && + sc->status_block->status_idx == sc->last_status_idx && (REG_RD(sc, BCE_PCICFG_MISC_STATUS) & BCE_PCICFG_MISC_STATUS_INTA_VALUE)) { DBPRINT(sc, BCE_VERBOSE_INTR, "%s(): Spurious interrupt.\n", @@ -7995,11 +7995,9 @@ bce_intr(void *xsc) if ((hw_rx_cons == sc->hw_rx_cons) && (hw_tx_cons == sc->hw_tx_cons)) break; - } - bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_PREREAD); /* Re-enable interrupts. */ bce_enable_intr(sc, 0); @@ -8124,6 +8122,8 @@ bce_stats_update(struct bce_softc *sc) ifp = sc->bce_ifp; + bus_dmamap_sync(sc->stats_tag, sc->stats_map, BUS_DMASYNC_POSTREAD); + stats = (struct statistics_block *) sc->stats_block; /* @@ -8651,6 +8651,8 @@ bce_sysctl_stats_clear(SYSCTL_HANDLER_AR stats = (struct statistics_block *) sc->stats_block; bzero(stats, sizeof(struct statistics_block)); + bus_dmamap_sync(sc->stats_tag, sc->stats_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Clear the internal H/W statistics counters. */ REG_WR(sc, BCE_HC_COMMAND, BCE_HC_COMMAND_CLR_STAT_NOW); @@ -10636,6 +10638,8 @@ bce_dump_status_block(struct bce_softc * { struct status_block *sblk; + bus_dmamap_sync(sc->status_tag, sc->status_map, BUS_DMASYNC_POSTREAD); + sblk = sc->status_block; BCE_PRINTF( @@ -10698,6 +10702,8 @@ bce_dump_stats_block(struct bce_softc *s { struct statistics_block *sblk; + bus_dmamap_sync(sc->stats_tag, sc->stats_map, BUS_DMASYNC_POSTREAD); + sblk = sc->stats_block; BCE_PRINTF( From owner-svn-src-head@FreeBSD.ORG Thu May 30 21:24:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D4D387E; Thu, 30 May 2013 21:24:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80696A35; Thu, 30 May 2013 21:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULOYvg063562; Thu, 30 May 2013 21:24:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULOYw0063561; Thu, 30 May 2013 21:24:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302124.r4ULOYw0063561@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251160 - head/usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 21:24:34 -0000 Author: delphij Date: Thu May 30 21:24:33 2013 New Revision: 251160 URL: http://svnweb.freebsd.org/changeset/base/251160 Log: Convert Makefile to have only one file for each line, while I'm there, sort SRCS to ease future upgrades. Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Thu May 30 20:54:17 2013 (r251159) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Thu May 30 21:24:33 2013 (r251160) @@ -7,41 +7,136 @@ TCPDUMP_DISTDIR?= ${.CURDIR}/../../../co PROG= tcpdump -SRCS = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c \ - ipproto.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-forces.c print-fr.c \ - print-gre.c print-hsrp.c print-icmp.c print-igmp.c \ - print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \ - print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \ - print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ - print-lmp.c print-lspping.c \ - print-lwapp.c print-lwres.c print-mobile.c print-mpls.c print-msdp.c \ - print-msnlb.c \ +SRCS= addrtoname.c \ + af.c \ + checksum.c \ + cpack.c \ + gmpls.c \ + gmt2local.c \ + in_cksum.c \ + ipproto.c \ + l2vpn.c \ + machdep.c \ + nlpid.c \ + oui.c \ + parsenfsfh.c \ + print-802_11.c \ + print-802_15_4.c \ + print-ah.c \ + print-aodv.c \ + print-ap1394.c \ + print-arcnet.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-eap.c \ + print-egp.c \ + print-eigrp.c \ + print-enc.c \ + print-esp.c \ + print-ether.c \ + print-fddi.c \ + print-forces.c \ + print-fr.c \ + print-gre.c \ + print-hsrp.c \ + print-icmp.c \ + print-igmp.c \ + print-igrp.c \ + print-ip.c \ + print-ipcomp.c \ + print-ipfc.c \ + print-ipnet.c \ + print-ipx.c \ + print-isakmp.c \ + print-isoclns.c \ + print-juniper.c \ + print-krb.c \ + print-l2tp.c \ + print-lane.c \ + print-ldp.c \ + print-llc.c \ + print-lldp.c \ + print-lmp.c \ + print-lspping.c \ + print-lwapp.c \ + print-lwres.c \ + print-mobile.c \ print-mpcp.c \ - print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ + print-mpls.c \ + print-msdp.c \ + print-msnlb.c \ + print-nfs.c \ + print-ntp.c \ + print-null.c \ + print-olsr.c \ + print-ospf.c \ print-otv.c \ print-pfsync.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-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 \ - print-timed.c print-tipc.c \ - print-token.c print-udld.c print-udp.c print-vjc.c \ - print-vqp.c print-vrrp.c print-vtp.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-smb.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 \ + print-timed.c \ + print-tipc.c \ + print-token.c \ + print-udld.c \ + print-udp.c \ + print-vjc.c \ + print-vqp.c \ + print-vrrp.c \ + print-vtp.c \ print-vxlan.c \ - print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \ + print-wb.c \ + print-zephyr.c \ print-zeromq.c \ - print-smb.c signature.c smbutil.c \ + setsignal.c \ + signature.c \ + smbutil.c \ + tcpdump.c \ + util.c \ version.c CLEANFILES+= version.c @@ -50,9 +145,16 @@ CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -D_U_="__attribute__((unused))" .if ${MK_INET6_SUPPORT} != "no" -SRCS+= print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c \ - print-icmp6.c print-babel.c print-frag6.c print-rt6.c print-ospf6.c \ - print-dhcp6.c +SRCS+= print-babel.c \ + print-dhcp6.c \ + print-frag6.c \ + print-icmp6.c \ + print-ip6.c \ + print-ip6opts.c \ + print-mobility.c \ + print-ospf6.c \ + print-ripng.c \ + print-rt6.c CFLAGS+= -DINET6 .endif .if ${MACHINE_CPUARCH} != "i386" From owner-svn-src-head@FreeBSD.ORG Thu May 30 21:25:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49906A24; Thu, 30 May 2013 21:25:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BECCA4B; Thu, 30 May 2013 21:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULPuQZ063844; Thu, 30 May 2013 21:25:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULPuaE063843; Thu, 30 May 2013 21:25:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302125.r4ULPuaE063843@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251161 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 21:25:56 -0000 Author: delphij Date: Thu May 30 21:25:55 2013 New Revision: 251161 URL: http://svnweb.freebsd.org/changeset/base/251161 Log: Diff reduction against tcpdump revision 949a22064d3534eddeb8aa2b9c36a50e45fe16fa. Modified: head/contrib/tcpdump/interface.h Modified: head/contrib/tcpdump/interface.h ============================================================================== --- head/contrib/tcpdump/interface.h Thu May 30 21:24:33 2013 (r251160) +++ head/contrib/tcpdump/interface.h Thu May 30 21:25:55 2013 (r251161) @@ -224,7 +224,6 @@ extern void ntp_print(const u_char *, u_ extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *); extern void ospf_print(const u_char *, u_int, const u_char *); extern void olsr_print (const u_char *, u_int, int); -extern void otv_print(const u_char *, u_int); extern void pimv1_print(const u_char *, u_int); extern void cisco_autorp_print(const u_char *, u_int); extern void rsvp_print(const u_char *, u_int); @@ -324,7 +323,7 @@ extern u_int bt_if_print(const struct pc extern u_int usb_linux_48_byte_print(const struct pcap_pkthdr *, const u_char *); extern u_int usb_linux_64_byte_print(const struct pcap_pkthdr *, const u_char *); extern void vxlan_print(const u_char *, u_int); - +extern void otv_print(const u_char *, u_int); #ifdef INET6 From owner-svn-src-head@FreeBSD.ORG Thu May 30 21:57:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C7A309BF; Thu, 30 May 2013 21:57:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA300D12; Thu, 30 May 2013 21:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULveOg074733; Thu, 30 May 2013 21:57:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULveEN074732; Thu, 30 May 2013 21:57:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305302157.r4ULveEN074732@svn.freebsd.org> From: Mark Johnston Date: Thu, 30 May 2013 21:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251166 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 21:57:40 -0000 Author: markj Date: Thu May 30 21:57:40 2013 New Revision: 251166 URL: http://svnweb.freebsd.org/changeset/base/251166 Log: Add macros which allow one to define SDT probes with six or seven arguments; they are needed when porting some of the Solaris providers (ip, iscsi, and tcp in particular). dtrace_probe() only takes five arguments from the probe site, so we need to add the appropriate cast to allow for more than five arguments. The extra arguments are later copied out of dtrace_probe()'s stack frame by dtrace_getarg() (or the provider-specific getarg method) as needed. MFC after: 1 week Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Thu May 30 21:56:53 2013 (r251165) +++ head/sys/sys/sdt.h Thu May 30 21:57:40 2013 (r251166) @@ -91,6 +91,10 @@ #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2) #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_PROBE_DEFINE6(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5) +#define SDT_PROBE_DEFINE7(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5, arg6) #define SDT_PROBE0(prov, mod, func, name) #define SDT_PROBE1(prov, mod, func, name, arg0) @@ -98,6 +102,9 @@ #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) #define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) #else @@ -233,6 +240,27 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); + +#define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5, arg6) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6); + #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) \ @@ -245,6 +273,27 @@ struct sdt_provider { SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\ + } while (0) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \ + sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \ + (uintptr_t)arg6); \ + } while (0) typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *); typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *); From owner-svn-src-head@FreeBSD.ORG Thu May 30 21:59:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 61ABBBCA; Thu, 30 May 2013 21:59:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5436ED50; Thu, 30 May 2013 21:59:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULxU4X075098; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULxUx3075097; Thu, 30 May 2013 21:59:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305302159.r4ULxUx3075097@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 May 2013 21:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251167 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 30 May 2013 21:59:30 -0000 Author: pjd Date: Thu May 30 21:59:29 2013 New Revision: 251167 URL: http://svnweb.freebsd.org/changeset/base/251167 Log: If the -r option is given we cannot enter capability mode. The option tells kdump to convert numeric UIDs and GIDs into user and group names plus to convert times and dates into locallized versions. This all needs opening various files at various occasions. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu May 30 21:57:40 2013 (r251166) +++ head/usr.bin/kdump/kdump.c Thu May 30 21:59:29 2013 (r251167) @@ -240,8 +240,10 @@ main(int argc, char *argv[]) * XXXPJD: There should be strerror_init() and strsignal_init() in libc. */ (void)catopen("libc", NL_CAT_LOCALE); - if (cap_enter() < 0 && errno != ENOSYS) - err(1, "unable to enter capability mode"); + if (resolv == 0) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + } limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); From owner-svn-src-head@FreeBSD.ORG Fri May 31 00:21:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD8A08B4; Fri, 31 May 2013 00:21:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFFF57D1; Fri, 31 May 2013 00:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0L6L9025688; Fri, 31 May 2013 00:21:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0L6Nd025687; Fri, 31 May 2013 00:21:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305310021.r4V0L6Nd025687@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 00:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251169 - head/contrib/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 00:21:06 -0000 Author: delphij Date: Fri May 31 00:21:05 2013 New Revision: 251169 URL: http://svnweb.freebsd.org/changeset/base/251169 Log: Remove unused files. Deleted: head/contrib/less/Makefile.aut head/contrib/less/Makefile.dsb head/contrib/less/Makefile.dsg head/contrib/less/Makefile.dsu head/contrib/less/Makefile.in head/contrib/less/Makefile.o2e head/contrib/less/Makefile.o9c head/contrib/less/Makefile.o9u head/contrib/less/Makefile.wnb head/contrib/less/Makefile.wnm head/contrib/less/configure head/contrib/less/configure.ac head/contrib/less/defines.ds head/contrib/less/defines.h.in head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/install.sh head/contrib/less/less.man head/contrib/less/lessecho.man head/contrib/less/lesskey.man head/contrib/less/mkfuncs.awk head/contrib/less/mkinstalldirs From owner-svn-src-head@FreeBSD.ORG Fri May 31 00:31:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31E3DC4E; Fri, 31 May 2013 00:31:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6B4850; Fri, 31 May 2013 00:31:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0VkSK029240; Fri, 31 May 2013 00:31:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0VkYv029235; Fri, 31 May 2013 00:31:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305310031.r4V0VkYv029235@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 00:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251170 - head/contrib/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 00:31:47 -0000 Author: delphij Date: Fri May 31 00:31:45 2013 New Revision: 251170 URL: http://svnweb.freebsd.org/changeset/base/251170 Log: Revert files with no local changes to their vendor state to ease future upgrading. Modified: head/contrib/less/less.h head/contrib/less/line.c head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/search.c Modified: head/contrib/less/less.h ============================================================================== --- head/contrib/less/less.h Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/less.h Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/line.c ============================================================================== --- head/contrib/less/line.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/line.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/prompt.c ============================================================================== --- head/contrib/less/prompt.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/prompt.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/screen.c ============================================================================== --- head/contrib/less/screen.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/screen.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * Modified: head/contrib/less/search.c ============================================================================== --- head/contrib/less/search.c Fri May 31 00:21:05 2013 (r251169) +++ head/contrib/less/search.c Fri May 31 00:31:45 2013 (r251170) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* * Copyright (C) 1984-2012 Mark Nudelman * @@ -28,7 +27,6 @@ extern int linenums; extern int sc_height; extern int jump_sline; extern int bs_mode; -extern int less_is_more; extern int ctldisp; extern int status_col; extern void * constant ml_search; From owner-svn-src-head@FreeBSD.ORG Fri May 31 00:43:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3906F13; Fri, 31 May 2013 00:43:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2EA78DE; Fri, 31 May 2013 00:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V0hj0Y033056; Fri, 31 May 2013 00:43:45 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V0hgZn033028; Fri, 31 May 2013 00:43:42 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201305310043.r4V0hgZn033028@svn.freebsd.org> From: Jeff Roberson Date: Fri, 31 May 2013 00:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251171 - in head/sys: fs/ext2fs fs/nandfs fs/nfsclient fs/nfsserver kern nfsclient nfsserver sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 00:43:45 -0000 Author: jeff Date: Fri May 31 00:43:41 2013 New Revision: 251171 URL: http://svnweb.freebsd.org/changeset/base/251171 Log: - Convert the bufobj lock to rwlock. - Use a shared bufobj lock in getblk() and inmem(). - Convert softdep's lk to rwlock to match the bufobj lock. - Move INFREECNT to b_flags and protect it with the buf lock. - Remove unnecessary locking around bremfree() and BKGRDINPROG. Sponsored by: EMC / Isilon Storage Division Discussed with: mckusick, kib, mdf Modified: head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/nandfs/nandfs_segment.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_serv.c head/sys/sys/buf.h head/sys/sys/bufobj.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/ext2fs/ext2_inode.c Fri May 31 00:43:41 2013 (r251171) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/nandfs/nandfs_segment.c ============================================================================== --- head/sys/fs/nandfs/nandfs_segment.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nandfs/nandfs_segment.c Fri May 31 00:43:41 2013 (r251171) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -702,7 +703,7 @@ nandfs_save_buf(struct buf *bp, uint64_t if (bp->b_bufobj != bo) { BO_LOCK(bp->b_bufobj); BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, - BO_MTX(bp->b_bufobj)); + BO_LOCKPTR(bp->b_bufobj)); KASSERT(BUF_ISLOCKED(bp), ("Problem with locking buffer")); } Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri May 31 00:43:41 2013 (r251171) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -556,7 +557,7 @@ restart_locked: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~(B_ASYNC | B_MANAGED); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:43:41 2013 (r251171) @@ -2852,7 +2852,7 @@ loop: error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo), "nfsfsync", slpflag, slptimeo); + BO_LOCKPTR(bo), "nfsfsync", slpflag, slptimeo); if (error == 0) { BUF_UNLOCK(bp); goto loop; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 31 00:43:41 2013 (r251171) @@ -1321,7 +1321,7 @@ nfsvno_fsync(struct vnode *vp, u_int64_t */ if ((bp = gbincore(&vp->v_bufobj, lblkno)) != NULL) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | - LK_INTERLOCK, BO_MTX(bo)) == ENOLCK) { + LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { BO_LOCK(bo); continue; /* retry */ } Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_bio.c Fri May 31 00:43:41 2013 (r251171) @@ -418,11 +418,9 @@ bufcountwakeup(struct buf *bp) { int old; - KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p already counted as free", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags |= BV_INFREECNT; + bp->b_flags |= B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, 1); KASSERT(old >= 0 && old < nbuf, ("numfreebuffers climbed to %d", old + 1)); @@ -670,11 +668,10 @@ bufinit(void) for (i = 0; i < nbuf; i++) { bp = &buf[i]; bzero(bp, sizeof *bp); - bp->b_flags = B_INVAL; /* we're just an empty header */ + bp->b_flags = B_INVAL | B_INFREECNT; bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; - bp->b_vflags = BV_INFREECNT; /* buf is counted as free */ bp->b_xflags = 0; LIST_INIT(&bp->b_dep); BUF_LOCKINIT(bp); @@ -848,16 +845,14 @@ bremfree(struct buf *bp) ("bremfree: buffer %p already marked for delayed removal.", bp)); KASSERT(bp->b_qindex != QUEUE_NONE, ("bremfree: buffer %p not on a queue.", bp)); - BUF_ASSERT_HELD(bp); + BUF_ASSERT_XLOCKED(bp); bp->b_flags |= B_REMFREE; /* Fixup numfreebuffers count. */ if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { - KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + KASSERT((bp->b_flags & B_INFREECNT) != 0, ("buf %p not counted in numfreebuffers", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags &= ~BV_INFREECNT; + bp->b_flags &= ~B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, -1); KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); } @@ -892,7 +887,7 @@ bremfreel(struct buf *bp) bp, bp->b_vp, bp->b_flags); KASSERT(bp->b_qindex != QUEUE_NONE, ("bremfreel: buffer %p not on a queue.", bp)); - BUF_ASSERT_HELD(bp); + BUF_ASSERT_XLOCKED(bp); mtx_assert(&bqlock, MA_OWNED); TAILQ_REMOVE(&bufqueues[bp->b_qindex], bp, b_freelist); @@ -916,11 +911,9 @@ bremfreel(struct buf *bp) * numfreebuffers. */ if ((bp->b_flags & B_INVAL) || (bp->b_flags & B_DELWRI) == 0) { - KASSERT((bp->b_vflags & BV_INFREECNT) != 0, + KASSERT((bp->b_flags & B_INFREECNT) != 0, ("buf %p not counted in numfreebuffers", bp)); - if (bp->b_bufobj != NULL) - mtx_assert(BO_MTX(bp->b_bufobj), MA_OWNED); - bp->b_vflags &= ~BV_INFREECNT; + bp->b_flags &= ~B_INFREECNT; old = atomic_fetchadd_int(&numfreebuffers, -1); KASSERT(old > 0, ("numfreebuffers dropped to %d", old - 1)); } @@ -1476,15 +1469,10 @@ brelse(struct buf *bp) bp->b_flags &= ~B_RELBUF; else if (buf_vm_page_count_severe()) { /* - * The locking of the BO_LOCK is not necessary since - * BKGRDINPROG cannot be set while we hold the buf - * lock, it can only be cleared if it is already - * pending. - */ - if (bp->b_vp) { - if (!(bp->b_vflags & BV_BKGRDINPROG)) - bp->b_flags |= B_RELBUF; - } else + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ + if (!(bp->b_vflags & BV_BKGRDINPROG)) bp->b_flags |= B_RELBUF; } @@ -1603,16 +1591,9 @@ brelse(struct buf *bp) /* enqueue */ mtx_lock(&bqlock); /* Handle delayed bremfree() processing. */ - if (bp->b_flags & B_REMFREE) { - struct bufobj *bo; - - bo = bp->b_bufobj; - if (bo != NULL) - BO_LOCK(bo); + if (bp->b_flags & B_REMFREE) bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } + if (bp->b_qindex != QUEUE_NONE) panic("brelse: free buffer onto another queue???"); @@ -1676,16 +1657,8 @@ brelse(struct buf *bp) * if B_INVAL is set ). */ - if (!(bp->b_flags & B_DELWRI)) { - struct bufobj *bo; - - bo = bp->b_bufobj; - if (bo != NULL) - BO_LOCK(bo); + if (!(bp->b_flags & B_DELWRI)) bufcountwakeup(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } /* * Something we can maybe free or reuse @@ -1730,11 +1703,7 @@ bqrelse(struct buf *bp) if (bp->b_flags & B_MANAGED) { if (bp->b_flags & B_REMFREE) { mtx_lock(&bqlock); - if (bo != NULL) - BO_LOCK(bo); bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); mtx_unlock(&bqlock); } bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); @@ -1744,13 +1713,9 @@ bqrelse(struct buf *bp) mtx_lock(&bqlock); /* Handle delayed bremfree() processing. */ - if (bp->b_flags & B_REMFREE) { - if (bo != NULL) - BO_LOCK(bo); + if (bp->b_flags & B_REMFREE) bremfreel(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } + if (bp->b_qindex != QUEUE_NONE) panic("bqrelse: free buffer onto another queue???"); /* buffers with stale but valid contents */ @@ -1762,13 +1727,11 @@ bqrelse(struct buf *bp) #endif } else { /* - * The locking of the BO_LOCK for checking of the - * BV_BKGRDINPROG is not necessary since the - * BV_BKGRDINPROG cannot be set while we hold the buf - * lock, it can only be cleared if it is already - * pending. + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. */ - if (!buf_vm_page_count_severe() || (bp->b_vflags & BV_BKGRDINPROG)) { + if (!buf_vm_page_count_severe() || + (bp->b_vflags & BV_BKGRDINPROG)) { bp->b_qindex = QUEUE_CLEAN; TAILQ_INSERT_TAIL(&bufqueues[QUEUE_CLEAN], bp, b_freelist); @@ -1788,13 +1751,8 @@ bqrelse(struct buf *bp) } mtx_unlock(&bqlock); - if ((bp->b_flags & B_INVAL) || !(bp->b_flags & B_DELWRI)) { - if (bo != NULL) - BO_LOCK(bo); + if ((bp->b_flags & B_INVAL) || !(bp->b_flags & B_DELWRI)) bufcountwakeup(bp); - if (bo != NULL) - BO_UNLOCK(bo); - } /* * Something we can maybe free or reuse. @@ -1940,7 +1898,7 @@ vfs_bio_awrite(struct buf *bp) size = vp->v_mount->mnt_stat.f_iosize; maxcl = MAXPHYS / size; - BO_LOCK(bo); + BO_RLOCK(bo); for (i = 1; i < maxcl; i++) if (vfs_bio_clcheck(vp, size, lblkno + i, bp->b_blkno + ((i * size) >> DEV_BSHIFT)) == 0) @@ -1950,7 +1908,7 @@ vfs_bio_awrite(struct buf *bp) if (vfs_bio_clcheck(vp, size, lblkno - j, bp->b_blkno - ((j * size) >> DEV_BSHIFT)) == 0) break; - BO_UNLOCK(bo); + BO_RUNLOCK(bo); --j; ncl = i + j; /* @@ -2145,7 +2103,7 @@ getnewbuf_reuse_bp(struct buf *bp, int q bp->b_flags &= B_UNMAPPED | B_KVAALLOC; bp->b_ioflags = 0; bp->b_xflags = 0; - KASSERT((bp->b_vflags & BV_INFREECNT) == 0, + KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p still counted as free?", bp)); bp->b_vflags = 0; bp->b_vp = NULL; @@ -2293,24 +2251,19 @@ restart: */ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) continue; - if (bp->b_vp) { - BO_LOCK(bp->b_bufobj); - if (bp->b_vflags & BV_BKGRDINPROG) { - BO_UNLOCK(bp->b_bufobj); - BUF_UNLOCK(bp); - continue; - } - BO_UNLOCK(bp->b_bufobj); + /* + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ + if (bp->b_vflags & BV_BKGRDINPROG) { + BUF_UNLOCK(bp); + continue; } KASSERT(bp->b_qindex == qindex, ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); - if (bp->b_bufobj != NULL) - BO_LOCK(bp->b_bufobj); bremfreel(bp); - if (bp->b_bufobj != NULL) - BO_UNLOCK(bp->b_bufobj); mtx_unlock(&bqlock); /* * NOTE: nbp is now entirely invalid. We can only restart @@ -2653,14 +2606,15 @@ flushbufqueues(struct vnode *lvp, int qu BUF_UNLOCK(bp); continue; } - BO_LOCK(bp->b_bufobj); + /* + * BKGRDINPROG can only be set with the buf and bufobj + * locks both held. We tolerate a race to clear it here. + */ if ((bp->b_vflags & BV_BKGRDINPROG) != 0 || (bp->b_flags & B_DELWRI) == 0) { - BO_UNLOCK(bp->b_bufobj); BUF_UNLOCK(bp); continue; } - BO_UNLOCK(bp->b_bufobj); if (bp->b_flags & B_INVAL) { bremfreel(bp); mtx_unlock(&bqlock); @@ -2737,9 +2691,9 @@ incore(struct bufobj *bo, daddr_t blkno) { struct buf *bp; - BO_LOCK(bo); + BO_RLOCK(bo); bp = gbincore(bo, blkno); - BO_UNLOCK(bo); + BO_RUNLOCK(bo); return (bp); } @@ -3053,7 +3007,7 @@ loop: mtx_unlock(&nblock); } - BO_LOCK(bo); + BO_RLOCK(bo); bp = gbincore(bo, blkno); if (bp != NULL) { int lockflags; @@ -3067,7 +3021,7 @@ loop: lockflags |= LK_NOWAIT; error = BUF_TIMELOCK(bp, lockflags, - BO_MTX(bo), "getblk", slpflag, slptimeo); + BO_LOCKPTR(bo), "getblk", slpflag, slptimeo); /* * If we slept and got the lock we have to restart in case @@ -3094,11 +3048,8 @@ loop: bp->b_flags |= B_CACHE; if (bp->b_flags & B_MANAGED) MPASS(bp->b_qindex == QUEUE_NONE); - else { - BO_LOCK(bo); + else bremfree(bp); - BO_UNLOCK(bo); - } /* * check for size inconsistencies for non-VMIO case. @@ -3193,7 +3144,7 @@ loop: * returned by getnewbuf() is locked. Note that the returned * buffer is also considered valid (not marked B_INVAL). */ - BO_UNLOCK(bo); + BO_RUNLOCK(bo); /* * If the user does not want us to create the buffer, bail out * here. @@ -4400,7 +4351,7 @@ bufobj_wrefl(struct bufobj *bo) { KASSERT(bo != NULL, ("NULL bo in bufobj_wref")); - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); bo->bo_numoutput++; } @@ -4434,11 +4385,11 @@ bufobj_wwait(struct bufobj *bo, int slpf int error; KASSERT(bo != NULL, ("NULL bo in bufobj_wwait")); - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); error = 0; while (bo->bo_numoutput) { bo->bo_flag |= BO_WWAIT; - error = msleep(&bo->bo_numoutput, BO_MTX(bo), + error = msleep(&bo->bo_numoutput, BO_LOCKPTR(bo), slpflag | (PRIBIO + 1), "bo_wwait", timeo); if (error) break; @@ -4596,7 +4547,7 @@ DB_COMMAND(countfreebufs, db_coundfreebu for (i = 0; i < nbuf; i++) { bp = &buf[i]; - if ((bp->b_vflags & BV_INFREECNT) != 0) + if ((bp->b_flags & B_INFREECNT) != 0) nfree++; else used++; Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_cluster.c Fri May 31 00:43:41 2013 (r251171) @@ -133,7 +133,7 @@ cluster_read(struct vnode *vp, u_quad_t return 0; } else { bp->b_flags &= ~B_RAM; - BO_LOCK(bo); + BO_RLOCK(bo); for (i = 1; i < maxra; i++) { /* * Stop if the buffer does not exist or it @@ -156,7 +156,7 @@ cluster_read(struct vnode *vp, u_quad_t BUF_UNLOCK(rbp); } } - BO_UNLOCK(bo); + BO_RUNLOCK(bo); if (i >= maxra) { return 0; } @@ -396,17 +396,16 @@ cluster_rbuild(struct vnode *vp, u_quad_ * (marked B_CACHE), or locked (may be doing a * background write), or if the buffer is not * VMIO backed. The clustering code can only deal - * with VMIO-backed buffers. + * with VMIO-backed buffers. The bo lock is not + * required for the BKGRDINPROG check since it + * can not be set without the buf lock. */ - BO_LOCK(bo); if ((tbp->b_vflags & BV_BKGRDINPROG) || (tbp->b_flags & B_CACHE) || (tbp->b_flags & B_VMIO) == 0) { - BO_UNLOCK(bo); bqrelse(tbp); break; } - BO_UNLOCK(bo); /* * The buffer must be completely invalid in order to @@ -790,7 +789,7 @@ cluster_wbuild(struct vnode *vp, long si continue; } if (BUF_LOCK(tbp, - LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, BO_MTX(bo))) { + LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, BO_LOCKPTR(bo))) { ++start_lbn; --len; continue; @@ -891,7 +890,7 @@ cluster_wbuild(struct vnode *vp, long si */ if (BUF_LOCK(tbp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, - BO_MTX(bo))) + BO_LOCKPTR(bo))) break; if ((tbp->b_flags & (B_VMIO | B_CLUSTEROK | Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_default.c Fri May 31 00:43:41 2013 (r251171) @@ -662,7 +662,7 @@ loop2: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_INTERLOCK | LK_SLEEPFAIL, - BO_MTX(bo)) != 0) { + BO_LOCKPTR(bo)) != 0) { BO_LOCK(bo); goto loop1; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/kern/vfs_subr.c Fri May 31 00:43:41 2013 (r251171) @@ -1073,7 +1073,7 @@ alloc: */ bo = &vp->v_bufobj; bo->__bo_vnode = vp; - mtx_init(BO_MTX(bo), "bufobj interlock", NULL, MTX_DEF); + rw_init(BO_LOCKPTR(bo), "bufobj interlock"); bo->bo_ops = &buf_ops_bio; bo->bo_private = vp; TAILQ_INIT(&bo->bo_clean.bv_hd); @@ -1331,7 +1331,7 @@ flushbuflist(struct bufv *bufv, int flag daddr_t lblkno; b_xflags_t xflags; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); retval = 0; TAILQ_FOREACH_SAFE(bp, &bufv->bv_hd, b_bobufs, nbp) { @@ -1347,7 +1347,7 @@ flushbuflist(struct bufv *bufv, int flag } retval = EAGAIN; error = BUF_TIMELOCK(bp, - LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_MTX(bo), + LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo), "flushbuf", slpflag, slptimeo); if (error) { BO_LOCK(bo); @@ -1369,17 +1369,13 @@ flushbuflist(struct bufv *bufv, int flag */ if (((bp->b_flags & (B_DELWRI | B_INVAL)) == B_DELWRI) && (flags & V_SAVE)) { - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= B_ASYNC; bwrite(bp); BO_LOCK(bo); return (EAGAIN); /* XXX: why not loop ? */ } - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1426,12 +1422,10 @@ restart: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1452,11 +1446,9 @@ restart: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) + BO_LOCKPTR(bo)) == ENOLCK) goto restart; - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1484,15 +1476,13 @@ restartsync: */ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo)) == ENOLCK) { + BO_LOCKPTR(bo)) == ENOLCK) { goto restart; } VNASSERT((bp->b_flags & B_DELWRI), vp, ("buf(%p) on dirty queue without DELWRI", bp)); - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bawrite(bp); BO_LOCK(bo); goto restartsync; @@ -1512,7 +1502,7 @@ buf_vlist_remove(struct buf *bp) struct bufv *bv; KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); - ASSERT_BO_LOCKED(bp->b_bufobj); + ASSERT_BO_WLOCKED(bp->b_bufobj); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) != (BX_VNDIRTY|BX_VNCLEAN), ("buf_vlist_remove: Buf %p is on two lists", bp)); @@ -1538,7 +1528,7 @@ buf_vlist_add(struct buf *bp, struct buf struct buf *n; int error; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) == 0, ("buf_vlist_add: Buf %p has existing xflags %d", bp, bp->b_xflags)); bp->b_xflags |= xflags; @@ -1598,7 +1588,7 @@ bgetvp(struct vnode *vp, struct buf *bp) struct bufobj *bo; bo = &vp->v_bufobj; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); VNASSERT(bp->b_vp == NULL, bp->b_vp, ("bgetvp: not free")); CTR3(KTR_BUF, "bgetvp(%p) vp %p flags %X", bp, vp, bp->b_flags); @@ -1657,7 +1647,7 @@ vn_syncer_add_to_worklist(struct bufobj { int slot; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); mtx_lock(&sync_mtx); if (bo->bo_flag & BO_ONWORKLST) @@ -2422,7 +2412,7 @@ vdropl(struct vnode *vp) rangelock_destroy(&vp->v_rl); lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); - mtx_destroy(BO_MTX(bo)); + rw_destroy(BO_LOCKPTR(bo)); uma_zfree(vnode_zone, vp); } Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsclient/nfs_subs.c Fri May 31 00:43:41 2013 (r251171) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsclient/nfs_vnops.c Fri May 31 00:43:41 2013 (r251171) @@ -3177,7 +3177,7 @@ loop: error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, - BO_MTX(bo), "nfsfsync", slpflag, slptimeo); + BO_LOCKPTR(bo), "nfsfsync", slpflag, slptimeo); if (error == 0) { BUF_UNLOCK(bp); goto loop; Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/nfsserver/nfs_serv.c Fri May 31 00:43:41 2013 (r251171) @@ -3387,7 +3387,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd */ if ((bp = gbincore(&vp->v_bufobj, lblkno)) != NULL) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | - LK_INTERLOCK, BO_MTX(bo)) == ENOLCK) { + LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { BO_LOCK(bo); continue; /* retry */ } Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri May 31 00:31:45 2013 (r251170) +++ head/sys/sys/buf.h Fri May 31 00:43:41 2013 (r251171) @@ -215,7 +215,7 @@ struct buf { #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ #define B_00800000 0x00800000 /* Available flag. */ #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ -#define B_02000000 0x02000000 /* Available flag. */ +#define B_INFREECNT 0x02000000 /* buf is counted in numfreebufs */ #define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */ #define B_MANAGED 0x08000000 /* Managed by FS. */ #define B_RAM 0x10000000 /* Read ahead mark (flag) */ @@ -224,7 +224,7 @@ struct buf { #define B_REMFREE 0x80000000 /* Delayed bremfree */ #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ - "\33paging\32needsgiant\31nocopy\30b23\27relbuf\26dirty\25b20" \ + "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ "\15b12\14b11\13eintr\12done\11persist\10delwri\7validsuspwrt" \ "\6cache\5deferred\4direct\3async\2needcommit\1age" @@ -248,9 +248,8 @@ struct buf { #define BV_SCANNED 0x00000001 /* VOP_FSYNC funcs mark written bufs */ #define BV_BKGRDINPROG 0x00000002 /* Background write in progress */ #define BV_BKGRDWAIT 0x00000004 /* Background write waiting */ -#define BV_INFREECNT 0x80000000 /* buf is counted in numfreebufs */ -#define PRINT_BUF_VFLAGS "\20\40infreecnt\3bkgrdwait\2bkgrdinprog\1scanned" +#define PRINT_BUF_VFLAGS "\20\3bkgrdwait\2bkgrdinprog\1scanned" #ifdef _KERNEL /* @@ -271,7 +270,7 @@ extern const char *buf_wmesg; /* Defaul * Get a lock sleeping non-interruptably until it becomes available. */ #define BUF_LOCK(bp, locktype, interlock) \ - _lockmgr_args(&(bp)->b_lock, (locktype), (interlock), \ + _lockmgr_args_rw(&(bp)->b_lock, (locktype), (interlock), \ LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, \ LOCK_FILE, LOCK_LINE) @@ -279,7 +278,7 @@ extern const char *buf_wmesg; /* Defaul * Get a lock sleeping with specified interruptably and timeout. */ #define BUF_TIMELOCK(bp, locktype, interlock, wmesg, catch, timo) \ - _lockmgr_args(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \ + _lockmgr_args_rw(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \ (interlock), (wmesg), (PRIBIO + 4) | (catch), (timo), \ LOCK_FILE, LOCK_LINE) Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Fri May 31 00:31:45 2013 (r251170) +++ head/sys/sys/bufobj.h Fri May 31 00:43:41 2013 (r251171) @@ -53,7 +53,7 @@ #include #include -#include +#include #include struct bufobj; @@ -89,7 +89,7 @@ struct buf_ops { #define BO_BDFLUSH(bo, bp) ((bo)->bo_ops->bop_bdflush((bo), (bp))) struct bufobj { - struct mtx bo_mtx; /* Mutex which protects "i" things */ + struct rwlock bo_lock; /* Lock which protects "i" things */ struct buf_ops *bo_ops; /* - Buffer operations */ struct vm_object *bo_object; /* v Place to store VM object */ LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ @@ -113,11 +113,14 @@ struct bufobj { #define BO_ONWORKLST (1 << 0) /* On syncer work-list */ #define BO_WWAIT (1 << 1) /* Wait for output to complete */ -#define BO_MTX(bo) (&(bo)->bo_mtx) -#define BO_LOCK(bo) mtx_lock(BO_MTX((bo))) -#define BO_UNLOCK(bo) mtx_unlock(BO_MTX((bo))) -#define ASSERT_BO_LOCKED(bo) mtx_assert(BO_MTX((bo)), MA_OWNED) -#define ASSERT_BO_UNLOCKED(bo) mtx_assert(BO_MTX((bo)), MA_NOTOWNED) +#define BO_LOCKPTR(bo) (&(bo)->bo_lock) +#define BO_LOCK(bo) rw_wlock(BO_LOCKPTR((bo))) +#define BO_UNLOCK(bo) rw_wunlock(BO_LOCKPTR((bo))) +#define BO_RLOCK(bo) rw_rlock(BO_LOCKPTR((bo))) +#define BO_RUNLOCK(bo) rw_runlock(BO_LOCKPTR((bo))) +#define ASSERT_BO_WLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_WLOCKED) +#define ASSERT_BO_LOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_LOCKED) +#define ASSERT_BO_UNLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_UNLOCKED) void bufobj_wdrop(struct bufobj *bo); void bufobj_wref(struct bufobj *bo); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_inode.c Fri May 31 00:43:41 2013 (r251171) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri May 31 00:43:41 2013 (r251171) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2204,10 +2205,8 @@ ffs_bdflush(bo, bp) if (bp_bdskip) { VI_LOCK(devvp); if (!ffs_bp_snapblk(vp, nbp)) { - if (BO_MTX(bo) != VI_MTX(vp)) { - VI_UNLOCK(devvp); - BO_LOCK(bo); - } + VI_UNLOCK(devvp); + BO_LOCK(bo); BUF_UNLOCK(nbp); continue; } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri May 31 00:31:45 2013 (r251170) +++ head/sys/ufs/ffs/ffs_softdep.c Fri May 31 00:43:41 2013 (r251171) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -554,7 +555,7 @@ softdep_check_suspend(struct mount *mp, (void) softdep_accdeps; bo = &devvp->v_bufobj; - ASSERT_BO_LOCKED(bo); + ASSERT_BO_WLOCKED(bo); MNT_ILOCK(mp); while (mp->mnt_secondary_writes != 0) { @@ -808,7 +809,7 @@ struct jextent { */ static void softdep_error(char *, int); static void drain_output(struct vnode *); -static struct buf *getdirtybuf(struct buf *, struct mtx *, int); +static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); static void clear_remove(void); static void clear_inodedeps(void); static void unlinked_inodedep(struct mount *, struct inodedep *); @@ -1030,12 +1031,12 @@ static void softdep_disk_write_complete( static void softdep_deallocate_dependencies(struct buf *); static int softdep_count_dependencies(struct buf *bp, int); -static struct mtx lk; -MTX_SYSINIT(softdep_lock, &lk, "Softdep Lock", MTX_DEF); +static struct rwlock lk; +RW_SYSINIT(softdep_lock, &lk, "Softdep Lock"); -#define TRY_ACQUIRE_LOCK(lk) mtx_trylock(lk) -#define ACQUIRE_LOCK(lk) mtx_lock(lk) -#define FREE_LOCK(lk) mtx_unlock(lk) +#define TRY_ACQUIRE_LOCK(lk) rw_try_wlock(lk) +#define ACQUIRE_LOCK(lk) rw_wlock(lk) +#define FREE_LOCK(lk) rw_wunlock(lk) #define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) #define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) @@ -1073,7 +1074,7 @@ worklist_insert(head, item, locked) { if (locked) - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (item->wk_state & ONWORKLIST) panic("worklist_insert: %p %s(0x%X) already on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1088,7 +1089,7 @@ worklist_remove(item, locked) { if (locked) - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if ((item->wk_state & ONWORKLIST) == 0) panic("worklist_remove: %p %s(0x%X) not on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1161,7 +1162,7 @@ jwork_move(dst, src) freedep = freedep_merge(WK_FREEDEP(wk), freedep); } - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); while ((wk = LIST_FIRST(src)) != NULL) { WORKLIST_REMOVE(wk); WORKLIST_INSERT(dst, wk); @@ -1212,7 +1213,7 @@ workitem_free(item, type) int type; { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); #ifdef DEBUG if (item->wk_state & ONWORKLIST) @@ -1428,7 +1429,7 @@ softdep_flush(void) static void worklist_speedup(void) { - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (req_pending == 0) { req_pending = 1; wakeup(&req_pending); @@ -1462,7 +1463,7 @@ add_to_worklist(wk, flags) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); if (wk->wk_state & ONWORKLIST) panic("add_to_worklist: %s(0x%X) already on list", @@ -1604,7 +1605,7 @@ process_removes(vp) struct mount *mp; ino_t inum; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = vp->v_mount; inum = VTOI(vp)->i_number; @@ -1654,7 +1655,7 @@ process_truncates(vp) ino_t inum; int cgwait; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = vp->v_mount; inum = VTOI(vp)->i_number; @@ -1727,7 +1728,7 @@ process_worklist_item(mp, target, flags) int matchcnt; int error; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); KASSERT(mp != NULL, ("process_worklist_item: NULL mp")); /* * If we are being called because of a process doing a @@ -2061,7 +2062,7 @@ pagedep_lookup(mp, bp, ino, lbn, flags, int ret; int i; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (bp) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_PAGEDEP) { @@ -2150,7 +2151,7 @@ inodedep_lookup(mp, inum, flags, inodede struct inodedep_hashhead *inodedephd; struct fs *fs; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); fs = VFSTOUFS(mp)->um_fs; inodedephd = INODEDEP_HASH(fs, inum); @@ -2704,7 +2705,7 @@ add_to_journal(wk) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); if (wk->wk_state & ONWORKLIST) panic("add_to_journal: %s(0x%X) already on list", @@ -2730,7 +2731,7 @@ remove_from_journal(wk) { struct ufsmount *ump; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); #ifdef SUJ_DEBUG { @@ -2898,7 +2899,7 @@ softdep_prelink(dvp, vp) struct ufsmount *ump; ump = VFSTOUFS(dvp->v_mount); - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); /* * Nothing to do if we have sufficient journal space. * If we currently hold the snapshot lock, we must avoid @@ -4986,7 +4987,7 @@ bmsafemap_lookup(mp, bp, cg, newbmsafema struct worklist *wk; struct fs *fs; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); KASSERT(bp != NULL, ("bmsafemap_lookup: missing buffer")); LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_BMSAFEMAP) { @@ -5257,7 +5258,7 @@ allocdirect_merge(adphead, newadp, oldad struct freefrag *freefrag; freefrag = NULL; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); if (newadp->ad_oldblkno != oldadp->ad_newblkno || newadp->ad_oldsize != oldadp->ad_newsize || newadp->ad_offset >= NDADDR) @@ -5718,7 +5719,7 @@ indirdep_lookup(mp, ip, bp) struct fs *fs; ufs2_daddr_t blkno; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); indirdep = NULL; newindirdep = NULL; fs = ip->i_fs; @@ -5797,7 +5798,7 @@ setup_allocindir_phase2(bp, ip, inodedep struct freefrag *freefrag; struct mount *mp; - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); mp = UFSTOVFS(ip->i_ump); fs = ip->i_fs; if (bp->b_lblkno >= 0) @@ -6130,7 +6131,7 @@ complete_trunc_indir(freework) BUF_UNLOCK(bp); ACQUIRE_LOCK(&lk); } - mtx_assert(&lk, MA_OWNED); + rw_assert(&lk, RA_WLOCKED); freework->fw_state |= DEPCOMPLETE; TAILQ_REMOVE(&indirdep->ir_trunc, freework, fw_next); /* @@ -6874,7 +6875,7 @@ restart: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 31 01:01:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8993B3EB; Fri, 31 May 2013 01:01:17 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA899F2; Fri, 31 May 2013 01:01:16 +0000 (UTC) Received: by mail-qe0-f47.google.com with SMTP id f6so569473qej.6 for ; Thu, 30 May 2013 18:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=O9wXmPMzZqW3Rs4h2J0M1iqpoic2VtW1FtignLIFu/0=; b=VYGT8iw7LEu6kQ5rctYjzQ24MSYn4qiPAHoc064NkR8AYbii859hFJ4mlHzu5tZfX5 hIVbXFueTagP9m/2RGNe/3Fb/x6Ib8ju1zIaDZ9VSxAn3Bde7mH4gThuZS6edGGwuBaK stSUxfL4VXxJQEGdmZsV+0ZSoJJn31Lfob296z7tg8oW0eY5/D2gG7MKFtW7vV1w0kFA njtmFGpD6lVu03irqf3BDR4PYT/3h6sXIkmmZZTU5gHnet/uQjStlGD7c/YXOf2dCOrK FIVVM3zYjxs3kdQW23J+5x5v4zKtbjMFEFcf2Cheki/S50bVLtpqY8A0smy6wGAl2kqb bpuw== MIME-Version: 1.0 X-Received: by 10.224.182.136 with SMTP id cc8mr8313738qab.10.1369962076155; Thu, 30 May 2013 18:01:16 -0700 (PDT) Received: by 10.49.3.193 with HTTP; Thu, 30 May 2013 18:01:16 -0700 (PDT) In-Reply-To: <201305310043.r4V0hgZn033028@svn.freebsd.org> References: <201305310043.r4V0hgZn033028@svn.freebsd.org> Date: Thu, 30 May 2013 21:01:16 -0400 Message-ID: Subject: Re: svn commit: r251171 - in head/sys: fs/ext2fs fs/nandfs fs/nfsclient fs/nfsserver kern nfsclient nfsserver sys ufs/ffs From: Benjamin Kaduk To: Jeff Roberson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 01:01:17 -0000 On Thu, May 30, 2013 at 8:43 PM, Jeff Roberson wrote: > Author: jeff > Date: Fri May 31 00:43:41 2013 > New Revision: 251171 > URL: http://svnweb.freebsd.org/changeset/base/251171 > > Log: > - Convert the bufobj lock to rwlock. > - Use a shared bufobj lock in getblk() and inmem(). > - Convert softdep's lk to rwlock to match the bufobj lock. > - Move INFREECNT to b_flags and protect it with the buf lock. > - Remove unnecessary locking around bremfree() and BKGRDINPROG. > Do we need a __FreeBSD_version bump for out-of-tree filesystems? -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Fri May 31 03:14:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80DB71114; Fri, 31 May 2013 03:14:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74317B4E; Fri, 31 May 2013 03:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V3EoLa087788; Fri, 31 May 2013 03:14:50 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V3Eo59087787; Fri, 31 May 2013 03:14:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305310314.r4V3Eo59087787@svn.freebsd.org> From: Sean Bruno Date: Fri, 31 May 2013 03:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251172 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 03:14:50 -0000 Author: sbruno Date: Fri May 31 03:14:49 2013 New Revision: 251172 URL: http://svnweb.freebsd.org/changeset/base/251172 Log: xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. MFC this if svn 249468-242726 is shoveled back to stable/9 Obtained from: Yahoo! Inc. Modified: head/sys/dev/mfi/mfi_cam.c Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Fri May 31 00:43:41 2013 (r251171) +++ head/sys/dev/mfi/mfi_cam.c Fri May 31 03:14:49 2013 (r251172) @@ -318,13 +318,16 @@ mfip_cam_rescan(struct mfi_softc *sc, ui } sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); device_printf(sc->mfi_dev, "Cannot create path for bus rescan.\n"); return; } + mtx_unlock(&sc->mfi_io_lock); xpt_rescan(ccb); From owner-svn-src-head@FreeBSD.ORG Fri May 31 03:30:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D33DA156A; Fri, 31 May 2013 03:30:12 +0000 (UTC) Date: Fri, 31 May 2013 03:30:12 +0000 From: Alexey Dokuchaev To: David Schultz Subject: Re: svn commit: r251121 - in head: include lib/msun lib/msun/man lib/msun/src Message-ID: <20130531033012.GB42068@FreeBSD.org> References: <201305300449.r4U4nRqM012625@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305300449.r4U4nRqM012625@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 03:30:12 -0000 On Thu, May 30, 2013 at 04:49:27AM +0000, David Schultz wrote: > New Revision: 251121 > URL: http://svnweb.freebsd.org/changeset/base/251121 > > Log: > I'm happy to finally commit stephen@'s implementations of cacos, > cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ > for working on these. This is awesome, but I did not see __FreeBSD_version bumped. Many ports rely on math functions, and having coherent OSVERSIONs really helps to decide when some function is natively supported, or emulation code required. ./danfe From owner-svn-src-head@FreeBSD.ORG Fri May 31 04:19:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 256651D79; Fri, 31 May 2013 04:19:14 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1658FE02; Fri, 31 May 2013 04:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4JDto009283; Fri, 31 May 2013 04:19:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4JDR9009282; Fri, 31 May 2013 04:19:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305310419.r4V4JDR9009282@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 04:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251173 - head/tools/regression/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 04:19:14 -0000 Author: obrien Date: Fri May 31 04:19:13 2013 New Revision: 251173 URL: http://svnweb.freebsd.org/changeset/base/251173 Log: Allow building with clang (which is being really stupid here...). Modified: head/tools/regression/filemon/timed-forkb.c Modified: head/tools/regression/filemon/timed-forkb.c ============================================================================== --- head/tools/regression/filemon/timed-forkb.c Fri May 31 03:14:49 2013 (r251172) +++ head/tools/regression/filemon/timed-forkb.c Fri May 31 04:19:13 2013 (r251173) @@ -45,6 +45,7 @@ #define SLEEP 20 /* seconds */ #endif +extern int verbose; int verbose; static void From owner-svn-src-head@FreeBSD.ORG Fri May 31 04:27:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2308E6; Fri, 31 May 2013 04:27:41 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4F01E64; Fri, 31 May 2013 04:27:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4Rf2j012377; Fri, 31 May 2013 04:27:41 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4RfSq012376; Fri, 31 May 2013 04:27:41 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305310427.r4V4RfSq012376@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 04:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251174 - head/tools/regression/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 04:27:41 -0000 Author: obrien Date: Fri May 31 04:27:41 2013 New Revision: 251174 URL: http://svnweb.freebsd.org/changeset/base/251174 Log: Different approach to making all compilers happy. Modified: head/tools/regression/filemon/timed-forkb.c Modified: head/tools/regression/filemon/timed-forkb.c ============================================================================== --- head/tools/regression/filemon/timed-forkb.c Fri May 31 04:19:13 2013 (r251173) +++ head/tools/regression/filemon/timed-forkb.c Fri May 31 04:27:41 2013 (r251174) @@ -45,8 +45,7 @@ #define SLEEP 20 /* seconds */ #endif -extern int verbose; -int verbose; +static int verbose; static void usage(void) From owner-svn-src-head@FreeBSD.ORG Fri May 31 04:43:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 795694AE; Fri, 31 May 2013 04:43:20 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE82F0C; Fri, 31 May 2013 04:43:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4hKJJ018320; Fri, 31 May 2013 04:43:20 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4hKvo018319; Fri, 31 May 2013 04:43:20 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305310443.r4V4hKvo018319@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 04:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251175 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 04:43:20 -0000 Author: gibbs Date: Fri May 31 04:43:19 2013 New Revision: 251175 URL: http://svnweb.freebsd.org/changeset/base/251175 Log: Apply the ad* => ada* IDE device name transition to the Xen block front driver. Submitted by: Bei Guan Reviewed by: gibbs MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 04:27:41 2013 (r251174) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 04:43:19 2013 (r251175) @@ -148,16 +148,16 @@ blkfront_vdevice_to_unit(uint32_t vdevic int base; const char *name; } info[] = { - {3, 6, 0, "ad"}, /* ide0 */ - {22, 6, 2, "ad"}, /* ide1 */ - {33, 6, 4, "ad"}, /* ide2 */ - {34, 6, 6, "ad"}, /* ide3 */ - {56, 6, 8, "ad"}, /* ide4 */ - {57, 6, 10, "ad"}, /* ide5 */ - {88, 6, 12, "ad"}, /* ide6 */ - {89, 6, 14, "ad"}, /* ide7 */ - {90, 6, 16, "ad"}, /* ide8 */ - {91, 6, 18, "ad"}, /* ide9 */ + {3, 6, 0, "ada"}, /* ide0 */ + {22, 6, 2, "ada"}, /* ide1 */ + {33, 6, 4, "ada"}, /* ide2 */ + {34, 6, 6, "ada"}, /* ide3 */ + {56, 6, 8, "ada"}, /* ide4 */ + {57, 6, 10, "ada"}, /* ide5 */ + {88, 6, 12, "ada"}, /* ide6 */ + {89, 6, 14, "ada"}, /* ide7 */ + {90, 6, 16, "ada"}, /* ide8 */ + {91, 6, 18, "ada"}, /* ide9 */ {8, 4, 0, "da"}, /* scsi disk0 */ {65, 4, 16, "da"}, /* scsi disk1 */ From owner-svn-src-head@FreeBSD.ORG Fri May 31 04:46:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B4B662E; Fri, 31 May 2013 04:46:00 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D025F1B; Fri, 31 May 2013 04:46:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4V4jx8H018879; Fri, 31 May 2013 04:45:59 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4V4jx7N018878; Fri, 31 May 2013 04:45:59 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305310445.r4V4jx7N018878@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 04:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251176 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 04:46:00 -0000 Author: gibbs Date: Fri May 31 04:45:59 2013 New Revision: 251176 URL: http://svnweb.freebsd.org/changeset/base/251176 Log: Make netif_free() safe to call on a partially initialized softc. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri May 31 04:43:19 2013 (r251175) +++ head/sys/dev/xen/netfront/netfront.c Fri May 31 04:45:59 2013 (r251176) @@ -2177,8 +2177,11 @@ netif_free(struct netfront_info *info) callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); ifmedia_removeall(&info->sc_media); - ether_ifdetach(info->xn_ifp); - if_free(info->xn_ifp); + if (info->xn_ifp != NULL) { + ether_ifdetach(info->xn_ifp); + if_free(info->xn_ifp); + info->xn_ifp = NULL; + } } static void From owner-svn-src-head@FreeBSD.ORG Fri May 31 06:42:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76A1779F; Fri, 31 May 2013 06:42:48 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 4025C80C; Fri, 31 May 2013 06:42:48 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id BD6E5BC135; Fri, 31 May 2013 06:42:39 +0000 (UTC) Date: Fri, 31 May 2013 08:42:39 +0200 From: Jeremie Le Hen To: Marcel Moolenaar Subject: Re: svn commit: r250991 - in head: contrib/jemalloc/include/jemalloc include lib/libc/stdlib/jemalloc Message-ID: <20130531064239.GF70224@caravan.chchile.org> Mail-Followup-To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201305251859.r4PIxChc053341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305251859.r4PIxChc053341@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 06:42:48 -0000 Hi Marcel, On Sat, May 25, 2013 at 06:59:12PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Sat May 25 18:59:11 2013 > New Revision: 250991 > URL: http://svnweb.freebsd.org/changeset/base/250991 > > Log: > Make the malloc(3) family of functions weak and make their non-weak > implementations visible for use by applications. The functions $F that > are now weak symbols are: > allocm, calloc, dallocm, free, malloc, malloc_usable_size, > nallocm, posix_memalign, rallocm, realloc, sallocm > > The non-weak implementations of $F are exported as __$F. > > Submitted by: stevek@juniper.net > Reviewed by: jasone@, kib@ > Approved by: jasone@ (jemalloc) > Obtained from: juniper Networks, Inc I don't understand what this brings. If an application want to override malloc() et al., it can just do it and the dynamic linker won't look up the libc's version. Would you mind giving an example of what is now possible with this change? Thanks, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-head@FreeBSD.ORG Fri May 31 14:45:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F2DC4853; Fri, 31 May 2013 14:45:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5007885; Fri, 31 May 2013 14:45:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEjPGV029368; Fri, 31 May 2013 14:45:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEjPb7029367; Fri, 31 May 2013 14:45:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305311445.r4VEjPb7029367@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 14:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251180 - head/tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 14:45:26 -0000 Author: jilles Date: Fri May 31 14:45:25 2013 New Revision: 251180 URL: http://svnweb.freebsd.org/changeset/base/251180 Log: sh: Add test cases for break outside a loop. In most shells (including our sh), break outside a loop does nothing with status 0, or at least does not abort. Therefore, scripts sometimes (buggily) depend on this. Added: head/tools/regression/bin/sh/builtins/break4.4 (contents, props changed) head/tools/regression/bin/sh/builtins/break5.4 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/break4.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break4.4 Fri May 31 14:45:25 2013 (r251180) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 Added: head/tools/regression/bin/sh/builtins/break5.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break5.4 Fri May 31 14:45:25 2013 (r251180) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 From owner-svn-src-head@FreeBSD.ORG Fri May 31 14:48:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 995A7EDE; Fri, 31 May 2013 14:48:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF3B8B5; Fri, 31 May 2013 14:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEmbg8030308; Fri, 31 May 2013 14:48:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEmbFO030307; Fri, 31 May 2013 14:48:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305311448.r4VEmbFO030307@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 14:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251181 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 14:48:37 -0000 Author: jilles Date: Fri May 31 14:48:37 2013 New Revision: 251181 URL: http://svnweb.freebsd.org/changeset/base/251181 Log: fork(2): #include is not needed. Modified: head/lib/libc/sys/fork.2 Modified: head/lib/libc/sys/fork.2 ============================================================================== --- head/lib/libc/sys/fork.2 Fri May 31 14:45:25 2013 (r251180) +++ head/lib/libc/sys/fork.2 Fri May 31 14:48:37 2013 (r251181) @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 31, 2013 .Dt FORK 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft pid_t .Fn fork void From owner-svn-src-head@FreeBSD.ORG Fri May 31 16:00:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE6A8157; Fri, 31 May 2013 16:00:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C11A7D66; Fri, 31 May 2013 16:00:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VG0gIZ058025; Fri, 31 May 2013 16:00:42 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VG0gkY058024; Fri, 31 May 2013 16:00:42 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305311600.r4VG0gkY058024@svn.freebsd.org> From: Alan Cox Date: Fri, 31 May 2013 16:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251183 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 16:00:42 -0000 Author: alc Date: Fri May 31 16:00:42 2013 New Revision: 251183 URL: http://svnweb.freebsd.org/changeset/base/251183 Log: Simplify the definition of vm_page_lock_assert(). There is no compelling reason to inline the implementation of vm_page_lock_assert() in the !KLD_MODULES case. Use the same implementation for both KLD_MODULES and !KLD_MODULES. Reviewed by: kib Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri May 31 15:19:00 2013 (r251182) +++ head/sys/vm/vm_page.h Fri May 31 16:00:42 2013 (r251183) @@ -222,18 +222,17 @@ extern struct mtx_padalign pa_lock[]; #define vm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_unlock(m) vm_page_unlock_KBI((m), LOCK_FILE, LOCK_LINE) #define vm_page_trylock(m) vm_page_trylock_KBI((m), LOCK_FILE, LOCK_LINE) -#if defined(INVARIANTS) -#define vm_page_lock_assert(m, a) \ - vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) -#else -#define vm_page_lock_assert(m, a) -#endif #else /* !KLD_MODULE */ #define vm_page_lockptr(m) (PA_LOCKPTR(VM_PAGE_TO_PHYS((m)))) #define vm_page_lock(m) mtx_lock(vm_page_lockptr((m))) #define vm_page_unlock(m) mtx_unlock(vm_page_lockptr((m))) #define vm_page_trylock(m) mtx_trylock(vm_page_lockptr((m))) -#define vm_page_lock_assert(m, a) mtx_assert(vm_page_lockptr((m)), (a)) +#endif +#if defined(INVARIANTS) +#define vm_page_lock_assert(m, a) \ + vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) +#else +#define vm_page_lock_assert(m, a) #endif /* From owner-svn-src-head@FreeBSD.ORG Fri May 31 16:15:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC221619; Fri, 31 May 2013 16:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF100E0C; Fri, 31 May 2013 16:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VGFMlF062964; Fri, 31 May 2013 16:15:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VGFMDZ062963; Fri, 31 May 2013 16:15:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311615.r4VGFMDZ062963@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 16:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251184 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 16:15:22 -0000 Author: jhb Date: Fri May 31 16:15:22 2013 New Revision: 251184 URL: http://svnweb.freebsd.org/changeset/base/251184 Log: Style fixes to vn_ioctl(). Suggested by: bde Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri May 31 16:00:42 2013 (r251183) +++ head/sys/kern/vfs_vnops.c Fri May 31 16:15:22 2013 (r251184) @@ -1355,31 +1355,32 @@ vn_ioctl(fp, com, data, active_cred, td) struct ucred *active_cred; struct thread *td; { - struct vnode *vp = fp->f_vnode; struct vattr vattr; + struct vnode *vp; int error; - error = ENOTTY; + vp = fp->f_vnode; switch (vp->v_type) { - case VREG: case VDIR: - if (com == FIONREAD) { + case VREG: + switch (com) { + case FIONREAD: vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); - if (!error) + if (error == 0) *(int *)data = vattr.va_size - fp->f_offset; - } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ - error = 0; - else - error = VOP_IOCTL(vp, com, data, fp->f_flag, - active_cred, td); - break; - + return (error); + case FIONBIO: + case FIOASYNC: + return (0); + default: + return (VOP_IOCTL(vp, com, data, fp->f_flag, + active_cred, td)); + } default: - break; + return (ENOTTY); } - return (error); } /* From owner-svn-src-head@FreeBSD.ORG Fri May 31 17:23:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04B7AB66; Fri, 31 May 2013 17:23:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB98F114; Fri, 31 May 2013 17:23:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHNcVB087354; Fri, 31 May 2013 17:23:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHNcif087353; Fri, 31 May 2013 17:23:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305311723.r4VHNcif087353@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 May 2013 17:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251186 - head/usr.sbin/acpi/acpidump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 17:23:39 -0000 Author: jkim Date: Fri May 31 17:23:38 2013 New Revision: 251186 URL: http://svnweb.freebsd.org/changeset/base/251186 Log: Fix a long standing logic bug introduced in r167814. The code was added to get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code and we always fell back to the previous method, i. e., sysctlbyname(3). MFC after: 3 days Modified: head/usr.sbin/acpi/acpidump/acpi_user.c Modified: head/usr.sbin/acpi/acpidump/acpi_user.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi_user.c Fri May 31 17:01:53 2013 (r251185) +++ head/usr.sbin/acpi/acpidump/acpi_user.c Fri May 31 17:23:38 2013 (r251186) @@ -172,7 +172,7 @@ acpi_find_rsd_ptr(void) addr = 0; /* Attempt to use kenv or sysctl to find RSD PTR record. */ - if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) == 0) + if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) > 0) addr = strtoul(buf, NULL, 0); if (addr == 0) { len = sizeof(addr); From owner-svn-src-head@FreeBSD.ORG Fri May 31 17:27:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 905D6D8B; Fri, 31 May 2013 17:27:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8318C153; Fri, 31 May 2013 17:27:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHRjUj088085; Fri, 31 May 2013 17:27:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHRjux088083; Fri, 31 May 2013 17:27:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305311727.r4VHRjux088083@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 17:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251187 - head/sys/dev/mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 17:27:45 -0000 Author: delphij Date: Fri May 31 17:27:44 2013 New Revision: 251187 URL: http://svnweb.freebsd.org/changeset/base/251187 Log: Explicitly use a pair of parentheses to ensure correct evaluation ordering for bitwise operation. Submitted by: swildner (DragonFly) MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt_raid.c head/sys/dev/mpt/mpt_user.c Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_raid.c Fri May 31 17:27:44 2013 (r251187) @@ -605,7 +605,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); + (write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST))); se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | raid_handler_id); Modified: head/sys/dev/mpt/mpt_user.c ============================================================================== --- head/sys/dev/mpt/mpt_user.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_user.c Fri May 31 17:27:44 2013 (r251187) @@ -548,8 +548,8 @@ mpt_user_raid_action(struct mpt_softc *m MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : - MPI_SGE_FLAGS_IOC_TO_HOST)); + (raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : + MPI_SGE_FLAGS_IOC_TO_HOST))); } se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | user_handler_id); From owner-svn-src-head@FreeBSD.ORG Fri May 31 17:30:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAA23CB; Fri, 31 May 2013 17:30:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCF418C; Fri, 31 May 2013 17:30:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VHUCTc088610; Fri, 31 May 2013 17:30:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VHUCSg088609; Fri, 31 May 2013 17:30:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305311730.r4VHUCSg088609@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 31 May 2013 17:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251188 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 17:30:12 -0000 Author: marcel Date: Fri May 31 17:30:12 2013 New Revision: 251188 URL: http://svnweb.freebsd.org/changeset/base/251188 Log: Fix "automatic" login, broken by revision 69825 (12 years, 5 months ago). The "automatic" login feature is described as follows: The USER environment variable holds the name of the person telnetting in. This is the username of the person on the client machine. The traditional behaviour is to execute login(1) with this username first, meaning that login(1) will prompt for the password only. If login fails, login(1) will retry, but now prompt for the username before prompting for the password. This feature got broken by how the environment got scrubbed. Before the change in r69825 we removed variables that we deemed dangerous. Starting with r69825 we only keep those variable we know to be safe. The USER environment variable fell through the cracks. It suddenly got scrubbed (i.e. removed from the environment) while still being checked for. It also got explicitly removed from the environment to handle the failed login case. The fix is to obtain the value of the USER environment variable before we scrub the environment and used the "cached" in subsequent checks. This guarantees that the environment does not contain the USER variable in the end, while still being able to implement "automatic" login. Obtained from: Juniper Networks, Inc. Modified: head/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Fri May 31 17:27:44 2013 (r251187) +++ head/contrib/telnet/telnetd/sys_term.c Fri May 31 17:30:12 2013 (r251188) @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -1026,6 +1026,10 @@ void start_login(char *host undef1, int autologin undef1, char *name undef1) { char **argv; + char *user; + + user = getenv("USER"); + user = (user != NULL) ? strdup(user) : NULL; scrub_env(); @@ -1160,9 +1164,9 @@ start_login(char *host undef1, int autol # endif } else #endif - if (getenv("USER")) { + if (user != NULL) { argv = addarg(argv, "--"); - argv = addarg(argv, getenv("USER")); + argv = addarg(argv, user); #if defined(LOGIN_ARGS) && defined(NO_LOGIN_P) { char **cpp; @@ -1170,17 +1174,6 @@ start_login(char *host undef1, int autol argv = addarg(argv, *cpp); } #endif - /* - * Assume that login will set the USER variable - * correctly. For SysV systems, this means that - * USER will no longer be set, just LOGNAME by - * login. (The problem is that if the auto-login - * fails, and the user then specifies a different - * account name, he can get logged in with both - * LOGNAME and USER in his environment, but the - * USER value will be wrong. - */ - unsetenv("USER"); } #ifdef AUTHENTICATION #if defined(NO_LOGIN_F) && defined(LOGIN_R) @@ -1190,6 +1183,9 @@ start_login(char *host undef1, int autol #endif /* AUTHENTICATION */ closelog(); + if (user != NULL) + free(user); + if (altlogin == NULL) { altlogin = _PATH_LOGIN; } From owner-svn-src-head@FreeBSD.ORG Fri May 31 19:07:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A270F75E; Fri, 31 May 2013 19:07:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93168824; Fri, 31 May 2013 19:07:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VJ7Lxq022781; Fri, 31 May 2013 19:07:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VJ7Hp8022745; Fri, 31 May 2013 19:07:17 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305311907.r4VJ7Hp8022745@svn.freebsd.org> From: Devin Teske Date: Fri, 31 May 2013 19:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251190 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/share security share share/media startup startup/share timezone timezone/share usermgmt usermg... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 19:07:21 -0000 Author: dteske Date: Fri May 31 19:07:17 2013 New Revision: 251190 URL: http://svnweb.freebsd.org/changeset/base/251190 Log: Improve portion of the dialog(1) API in dialog.subr responsible for calculating widget sizes. Instead of forking a sub-shell to calculate the optimum size for a widget, use a byRef style call-out to set variables in the parent namespace. For example, instead of: size=$( f_dialog_buttonbox_size title btitle msg ) $DIALOG --title title --backtitle btitle --msgbox msg $size The new API replaces the above with the following: f_dialog_buttonbox_size height width title btitle msg $DIALOG --title title --backtitle btitle --msgbox msg $height $width This reduces the number of forks, improves performance, and makes the code more readable by revealing the argument-order for widget sizing. It also makes performing minor adjustments to the calculated values easier as you no longer have to split-out the response (which required knowledge of ordering so was counter-intuitive). Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/bsdconfig Fri May 31 19:07:17 2013 (r251190) @@ -145,7 +145,7 @@ dialog_menu_main() local title="$DIALOG_TITLE" local btitle="$DIALOG_BACKTITLE" local prompt="$msg_menu_text" - local menu_list size + local menu_list menu_list=" 'X' '$msg_exit' '$msg_exit_bsdconfig' @@ -179,12 +179,13 @@ dialog_menu_main() index=$(( $index + 1 )) done - size=$( eval f_dialog_menu_with_help_size \ - \"\$title\" \ - \"\$btitle\" \ - \"\$prompt\" \ - \"\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_with_help_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -198,7 +199,9 @@ dialog_menu_main() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size $menu_list \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/console Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="$hline_configure_system_console_settings" local prompt="$msg_console_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '7 $msg_ttys' '$msg_choose_console_terminal_type' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -77,7 +78,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/font Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_font" local prompt="$msg_font_menu_text" @@ -70,12 +70,13 @@ dialog_menu_main() 'e $msg_swiss' '$msg_swiss_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get font8x8 )" in [Nn][Oo]|'') defaultitem="1 $msg_none";; @@ -102,7 +103,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/keymap Fri May 31 19:07:17 2013 (r251190) @@ -77,7 +77,7 @@ KEYMAP_NAMES=" # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_keyboard_map" local prompt="$msg_keymap_menu_text" @@ -110,12 +110,13 @@ dialog_menu_main() }' ) - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get keymap )" in be.iso) defaultitem="$msg_belgian";; @@ -200,7 +201,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/repeat Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_keyboard_repeat_rate" local prompt="$msg_repeat_menu_text" @@ -60,12 +60,13 @@ dialog_menu_main() '$msg_fast' '$msg_fast_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get keyrate )" in slow) defaultitem="$msg_slow";; @@ -82,7 +83,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/saver Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_screen_saver" local prompt="$msg_saver_menu_text" @@ -70,12 +70,13 @@ dialog_menu_main() '$msg_timeout' '$msg_timeout_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get saver )" in blank) defaultitem="1 $msg_blank" ;; @@ -101,7 +102,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/screenmap Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_choose_a_screen_map" local prompt="$msg_screenmap_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '6 $msg_koi8_u_to_ibm866u' '$msg_koi8_u_to_ibm866u_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get scrnmap )" in [Nn][Oo]|'') defaultitem="1 $msg_none" ;; @@ -86,7 +87,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/console/ttys Fri May 31 19:07:17 2013 (r251190) @@ -72,16 +72,16 @@ TTY_MENU_LIST=" # dialog_menu_main() { - local size local hline="$hline_choose_a_terminal_type" local prompt="$msg_ttys_menu_text" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $TTY_MENU_LIST ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $TTY_MENU_LIST local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -90,7 +90,8 @@ dialog_menu_main() --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $TTY_MENU_LIST \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/disable Fri May 31 19:07:17 2013 (r251190) @@ -86,16 +86,14 @@ f_sysrc_delete moused_flags || f_die f_dialog_title "$msg_message" hline="$hline_press_enter_or_space" prompt="$msg_mouse_daemon_is_disabled" -size=$( f_dialog_buttonbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$prompt" ) -eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --msgbox \"\$prompt\" $size +f_dialog_buttonbox_size height width \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" +$DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --msgbox "$prompt" $height $width exit $SUCCESS Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/mouse Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="" local prompt="$msg_menu_text" @@ -61,12 +61,13 @@ dialog_menu_main() '6 $msg_disable' '$msg_disable_the_mouse_daemon' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -76,7 +77,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/port Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="" local prompt="$msg_port_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '6 $msg_busmouse' '$msg_busmouse_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get moused_port )" in /dev/psm0) defaultitem="1 $msg_ps2" ;; @@ -86,7 +87,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/mouse/type Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="" local prompt="$msg_protocol_menu_text" @@ -66,12 +66,13 @@ dialog_menu_main() 'A $msg_thinkingmouse' '$msg_thinkingmouse_desc' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get moused_type )" in auto) defaultitem="1 $msg_auto" ;; @@ -94,7 +95,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/networking Fri May 31 19:07:17 2013 (r251190) @@ -48,7 +48,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size + local menu_list local hline="$hline_arrows_tab_enter" menu_list=" @@ -59,12 +59,13 @@ dialog_menu_main() '4' '$msg_dns_nameservers' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -74,7 +75,9 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$DEFAULTITEM_$$\" \ - --menu \"\" $size $menu_list \ + --menu \"\" \ + $height $width $rows \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri May 31 19:07:17 2013 (r251190) @@ -142,14 +142,15 @@ f_dialog_menu_netdev() # # Ask user to select an interface # - local prompt size + local prompt prompt="$msg_select_network_interface" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $interfaces ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $interfaces local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -158,7 +159,8 @@ f_dialog_menu_netdev() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $interfaces \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -175,7 +177,7 @@ f_dialog_menu_netdev() f_dialog_menu_netdev_edit() { local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5" - local prompt menu_list size + local prompt menu_list height width rows # # Create a duplicate set of variables for change-tracking... @@ -216,12 +218,12 @@ f_dialog_menu_netdev_edit() '4 $msg_netmask' '$netmask' '5 $msg_options' '$options' " - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -233,7 +235,8 @@ f_dialog_menu_netdev_edit() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri May 31 19:07:17 2013 (r251190) @@ -393,10 +393,12 @@ f_dialog_input_nameserver() # f_dialog_menu_nameservers() { + + local height width rows local opt_exit="$msg_return_to_previous_menu" local opt_add="$msg_add_nameserver" local hline="$hline_arrows_tab_enter" - local prompt size defaultitem= + local prompt defaultitem= # # Loop forever until the user has finished configuring nameservers @@ -427,12 +429,12 @@ f_dialog_menu_nameservers() # # Display configuration-edit menu # - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -441,7 +443,8 @@ f_dialog_menu_nameservers() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/password/share/password.subr Fri May 31 19:07:17 2013 (r251190) @@ -46,23 +46,25 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_dialog_input_password() { local hline="$hline_alnum_punc_tab_enter" - local msg size rmsg rsize + local msg rmsg msg=$( printf "$msg_enter_new_password" ) - size=$( f_dialog_inputbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$msg" \ - "" \ - "$hline" ) + local height1 width1 + f_dialog_inputbox_size height1 width1 \ + "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" \ + "$msg" \ + "" \ + "$hline" rmsg=$( printf "$msg_reenter_password" ) - rsize=$( f_dialog_inputbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$rmsg" \ - "" \ - "$hline" ) + local height2 width2 + f_dialog_inputbox_size height2 width2 \ + "$DIALOG_TITLE" \ + "$DIALOG_BACKTITLE" \ + "$rmsg" \ + "" \ + "$hline" # # Loop until the user provides taint-free/valid input @@ -70,14 +72,15 @@ f_dialog_input_password() local retval _password1 _password2 while :; do local dialog_inputbox - dialog_inputbox=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --insecure \ - --passwordbox \"\$msg\" $size \ + dialog_inputbox=$( $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --cancel-label "$msg_cancel" \ + --insecure \ + --passwordbox "$msg" \ + $height1 $width1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -88,14 +91,15 @@ f_dialog_input_password() # Return if user has either pressed ESC or chosen Cancel/No [ $retval -eq $SUCCESS ] || return $retval - dialog_inputbox=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --insecure \ - --passwordbox \"\$rmsg\" $rsize \ + dialog_inputbox=$( $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --cancel-label "$msg_cancel" \ + --insecure \ + --passwordbox "$rmsg" \ + $height2 $width2 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Fri May 31 19:07:17 2013 (r251190) @@ -51,7 +51,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size defaultitem= + local menu_list defaultitem= local hline="$hline_select_securelevel_to_operate_at" local prompt="$msg_securelevels_menu_text" @@ -62,12 +62,13 @@ dialog_menu_main() '$msg_network_secure' '$msg_network_secure_mode' " # END-QUOTE - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list case "$( f_sysrc_get kern_securelevel_enable )" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) @@ -91,7 +92,8 @@ dialog_menu_main() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/security/security Fri May 31 19:07:17 2013 (r251190) @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # dialog_menu_main() { - local menu_list size mark=" " defaultitem= + local menu_list mark=" " defaultitem= local hline="$hline_arrows_tab_enter" local prompt="$msg_menu_text" @@ -97,12 +97,13 @@ dialog_menu_main() # Update default-item if appropriate [ "$ditem" = 3 ] && defaultitem="3 [$mark] $msg_nfs_port" - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local dialog_menu dialog_menu=$( eval $DIALOG \ @@ -112,7 +113,8 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/share/device.subr Fri May 31 19:07:17 2013 (r251190) @@ -607,13 +607,13 @@ f_device_menu() menu_list="$menu_list '$dev' '$desc'" done - local size mtag - size=$( eval f_dialog_menu_size \ - \"\$title\" \ - \"\$btitle\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list local errexit= case $- in *e*) errexit=1; esac @@ -630,7 +630,8 @@ f_device_menu() --help-label \"\$msg_help\" \ ${USE_XDIALOG:+--help \"\"} \ } \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri May 31 18:27:21 2013 (r251189) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri May 31 19:07:17 2013 (r251190) @@ -83,6 +83,28 @@ unset XDIALOG_INFOBOX_TIMEOUT # : ${DEFAULT_TERMINAL_SIZE:=24 80} +# +# Minimum width(s) for various dialog(1) implementations (sensible global +# default(s) for all widgets of a given variant) +# +: ${DIALOG_MIN_WIDTH:=24} +: ${XDIALOG_MIN_WIDTH:=35} + +# +# When manually sizing Xdialog(1) widgets such as calendar and timebox, you'll +# need to know the size of the embedded GUI objects because the height passed +# to Xdialog(1) for these widgets has to be tall enough to accomodate them. +# +# These values are helpful when manually sizing with dialog(1) too, but in a +# different way. dialog(1) does not make you accomodate the custom items in the +# height (but does for width) -- a height of 3 will display three lines and a +# full calendar, for example (whereas Xdialog will truncate the calendar if +# given a height of 3). For dialog(1), use these values for making sure that +# the height does not exceed max_height (obtained by f_dialog_max_size()). +# +DIALOG_CALENDAR_HEIGHT=15 +DIALOG_TIMEBOX_HEIGHT=6 + ############################################################ GENERIC FUNCTIONS # f_dialog_title [$new_title] @@ -174,889 +196,1163 @@ f_dialog_backtitle_restore() ############################################################ SIZE FUNCTIONS -# f_dialog_infobox_size $title $backtitle $prompt [$hline] -# -# Not all versions of dialog(1) perform auto-sizing of the width and height of -# `--infobox' boxes sensibly. +# f_dialog_max_size $var_height $var_width # -# This function helps solve this issue by taking as arguments (in order of -# appearance) the title, backtitle, prompt, and [optionally] hline returning -# the optimal width and height for the box (not exceeding the actual terminal -# width or height). +# Get the maximum height and width for a dialog widget and store the values in +# $var_height and $var_width (respectively). # -# Newline character sequences (``\n'') in $prompt are expanded as-is done by -# dialog(1). -# -# Output is in the format of "height width". -# -f_dialog_infobox_size() +f_dialog_max_size() { - local title="$1" btitle="$2" prompt="$3" hline="$4" n=0 - local min_width max_size - + local __var_height="$1" __var_width="$2" __max_size + [ "$__var_height" -o "$__var_width" ] || return $FAILURE if [ "$USE_XDIALOG" ]; then - min_width=35 - max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION + __max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION else - min_width=24 - max_size=$( stty size 2> /dev/null ) # usually "24 80" - : ${max_size:=$DEFAULT_TERMINAL_SIZE} + __max_size=$( stty size 2> /dev/null ) # usually "24 80" + : ${__max_size:=$DEFAULT_TERMINAL_SIZE} fi + [ "$__var_height" ] && setvar "$__var_height" "${__max_size%%[$IFS]*}" + [ "$__var_width" ] && setvar "$__var_width" "${__max_size##*[$IFS]}" +} - local max_height="${max_size%%[$IFS]*}" - local max_width="${max_size##*[$IFS]}" - local height width=$min_width +# f_dialog_size_constrain $var_height $var_width [$min_height [$min_width]] +# +# Modify $var_height to be no-less-than $min_height (if given; zero otherwise) +# and no-greater-than terminal height (or screen height if $USE_XDIALOG is +# set). +# +# Also modify $var_width to be no-less-than $XDIALOG_MIN_WIDTH (or +# $XDIALOG_MIN_WIDTH if $_USE_XDIALOG is set) and no-greater-than terminal +# or screen width. The use of $[X]DIALOG_MIN_WIDTH can be overridden by +# passing $min_width. +# +# Return status is success unless one of the passed arguments is invalid +# or all of the $var_* arguments are either NULL or missing. +# +f_dialog_size_constrain() +{ + local __var_height="$1" __var_width="$2" + local __min_height="$3" __min_width="$4" + local __retval=$SUCCESS + + # Return failure unless at least one var_* argument is passed + [ "$__var_height" -o "$__var_width" ] || return $FAILURE # - # Bump width for long titles (but don't exceed terminal width). + # Print debug warnings if any given (non-NULL) argument are invalid + # NOTE: Don't change the name of $__{var,min,}{height,width} # - n=$(( ${#title} + 4 )) - if [ $n -gt $width -a $n -gt $min_width ]; then - # Add 16.6% width for Xdialog(1) - [ "$USE_XDIALOG" ] && n=$(( $n + $n / 6 )) + local __height __width + local __arg __cp __fname=f_dialog_size_constrain + for __arg in height width; do + debug= f_getvar __var_$__arg __cp + [ "$__cp" ] || continue + if ! f_getvar "$__cp" __$__arg; then + f_dprintf "%s: var_%s variable \`%s' not set" \ + $__fname $__arg "$__cp" + __retval=$FAILURE + elif ! eval f_isinteger \$__$__arg; then + f_dprintf "%s: var_%s variable value not a number" \ + $__fname $__arg + __retval=$FAILURE + fi + done + for __arg in height width; do + debug= f_getvar __min_$__arg __cp + [ "$__cp" ] || continue + f_isinteger "$__cp" && continue + f_dprintf "%s: min_%s value not a number" $__fname $__arg + __retval=$FAILURE + setvar __min_$__arg "" + done - if [ $n -lt $max_width ]; then - width=$n - else - width=$max_width + # Obtain maximum height and width values + # NOTE: Function name appended to prevent __var_{height,width} values + # from becoming local (and thus preventing setvar from working). + local __max_height_size_constain __max_width_size_constrain + f_dialog_max_size \ + __max_height_size_constrain __max_width_size_constrain + + # Adjust height if desired + if [ "$__var_height" ]; then + if [ $__height -lt ${__min_height:-0} ]; then + setvar "$__var_height" $__min_height + elif [ $__height -gt $__max_height_size_constrain ]; then + setvar "$__var_height" $__max_height_size_constrain fi fi - # - # For Xdialog(1), bump width for long backtitles (which appear within - # the window; don't exceed maximum width). - # - if [ "$USE_XDIALOG" ]; then - n=$(( ${#btitle} + 4 )) - n=$(( $n + $n / 6 )) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 31 20:07:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F61E69E; Fri, 31 May 2013 20:07:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0243CA38; Fri, 31 May 2013 20:07:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VK7Q9A043710; Fri, 31 May 2013 20:07:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VK7QJD043709; Fri, 31 May 2013 20:07:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305312007.r4VK7QJD043709@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 May 2013 20:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251192 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 20:07:27 -0000 Author: ed Date: Fri May 31 20:07:26 2013 New Revision: 251192 URL: http://svnweb.freebsd.org/changeset/base/251192 Log: Fix misspelling of structure field name. Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Fri May 31 19:13:22 2013 (r251191) +++ head/include/stdatomic.h Fri May 31 20:07:26 2013 (r251192) @@ -123,7 +123,7 @@ enum memory_order { #if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->val) + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) #else #define atomic_is_lock_free(obj) \ ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) From owner-svn-src-head@FreeBSD.ORG Fri May 31 20:46:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B82EEE; Fri, 31 May 2013 20:46:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC3A8B83; Fri, 31 May 2013 20:46:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VKk8mj057203; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VKk8Fc057202; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312046.r4VKk8Fc057202@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 20:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251194 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 20:46:08 -0000 Author: jilles Date: Fri May 31 20:46:08 2013 New Revision: 251194 URL: http://svnweb.freebsd.org/changeset/base/251194 Log: fork(2): Add information about fork() in multi-threaded processes. There is nothing about pthread_atfork(3) or extensions like calling malloc(3) in the child process as this may be unreliable or broken. Modified: head/lib/libc/sys/fork.2 Modified: head/lib/libc/sys/fork.2 ============================================================================== --- head/lib/libc/sys/fork.2 Fri May 31 20:11:07 2013 (r251193) +++ head/lib/libc/sys/fork.2 Fri May 31 20:46:08 2013 (r251194) @@ -73,6 +73,17 @@ are set to 0; see .It All interval timers are cleared; see .Xr setitimer 2 . +.It +The child process has only one thread, +corresponding to the calling thread in the parent process. +If the process has more than one thread, +locks and other resources held by the other threads are not released +and therefore only async-signal-safe functions +(see +.Xr sigaction 2 ) +are guaranteed to work in the child process until a call to +.Xr execve 2 +or a similar function. .El .Sh RETURN VALUES Upon successful completion, @@ -124,6 +135,7 @@ There is insufficient swap space for the .Xr rfork 2 , .Xr setitimer 2 , .Xr setrlimit 2 , +.Xr sigaction 2 , .Xr vfork 2 , .Xr wait 2 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Fri May 31 21:05:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EFC747D9; Fri, 31 May 2013 21:05:07 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0080CE5; Fri, 31 May 2013 21:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VL57XA064173; Fri, 31 May 2013 21:05:07 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VL57mw064171; Fri, 31 May 2013 21:05:07 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312105.r4VL57mw064171@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 21:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251195 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 21:05:08 -0000 Author: gibbs Date: Fri May 31 21:05:07 2013 New Revision: 251195 URL: http://svnweb.freebsd.org/changeset/base/251195 Log: Style cleanups. No intended functional changes. o This driver is the "xbd" driver, not the "blkfront", "blkif", "xbf", or "xb" driver. Use the "xbd_" naming conventions for all functions, structures, and constants. o The prevailing convention for structure fields in this driver is to prefix them with an abreviation of the structure type. Update "recently added" fields to match this style. o Remove unused data structures. o Remove superfluous casts. o Make a pass over the whole driver and bring it closer to style(9) conformance. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 20:46:08 2013 (r251194) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 21:05:07 2013 (r251195) @@ -1,6 +1,7 @@ /* * XenBSD block device driver * + * Copyright (c) 2010-2013 Spectra Logic Corporation * Copyright (c) 2009 Scott Long, Yahoo! * Copyright (c) 2009 Frank Suchomel, Citrix * Copyright (c) 2009 Doug F. Rabson, Citrix @@ -70,17 +71,17 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" /* prototypes */ -static void xb_free_command(struct xb_command *cm); -static void xb_startio(struct xb_softc *sc); -static void blkfront_connect(struct xb_softc *); -static void blkfront_closing(device_t); -static int blkfront_detach(device_t); -static int setup_blkring(struct xb_softc *); -static void blkif_int(void *); -static void blkfront_initialize(struct xb_softc *); -static int blkif_completion(struct xb_command *); -static void blkif_free(struct xb_softc *); -static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); +static void xbd_free_command(struct xbd_command *cm); +static void xbd_startio(struct xbd_softc *sc); +static void xbd_connect(struct xbd_softc *); +static void xbd_closing(device_t); +static int xbd_detach(device_t); +static int xbd_setup_ring(struct xbd_softc *); +static void xbd_int(void *); +static void xbd_initialize(struct xbd_softc *); +static int xbd_completion(struct xbd_command *); +static void xbd_free(struct xbd_softc *); +static void xbd_queue_cb(void *, bus_dma_segment_t *, int, int); static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); @@ -93,18 +94,18 @@ static MALLOC_DEFINE(M_XENBLOCKFRONT, "x static void vbd_update(void); #endif -#define BLKIF_STATE_DISCONNECTED 0 -#define BLKIF_STATE_CONNECTED 1 -#define BLKIF_STATE_SUSPENDED 2 +#define XBD_STATE_DISCONNECTED 0 +#define XBD_STATE_CONNECTED 1 +#define XBD_STATE_SUSPENDED 2 #ifdef notyet -static char *blkif_state_name[] = { - [BLKIF_STATE_DISCONNECTED] = "disconnected", - [BLKIF_STATE_CONNECTED] = "connected", - [BLKIF_STATE_SUSPENDED] = "closed", +static char *xbd_state_name[] = { + [XBD_STATE_DISCONNECTED] = "disconnected", + [XBD_STATE_CONNECTED] = "connected", + [XBD_STATE_SUSPENDED] = "closed", }; -static char * blkif_status_name[] = { +static char * xbd_status_name[] = { [BLKIF_INTERFACE_STATUS_CLOSED] = "closed", [BLKIF_INTERFACE_STATUS_DISCONNECTED] = "disconnected", [BLKIF_INTERFACE_STATUS_CONNECTED] = "connected", @@ -118,17 +119,17 @@ static char * blkif_status_name[] = { #define DPRINTK(fmt, args...) #endif -static int blkif_open(struct disk *dp); -static int blkif_close(struct disk *dp); -static int blkif_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); -static int blkif_queue_request(struct xb_softc *sc, struct xb_command *cm); -static void xb_strategy(struct bio *bp); +static int xbd_open(struct disk *dp); +static int xbd_close(struct disk *dp); +static int xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); +static int xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm); +static void xbd_strategy(struct bio *bp); // In order to quiesce the device during kernel dumps, outstanding requests to // DOM0 for disk reads/writes need to be accounted for. -static int xb_dump(void *, void *, vm_offset_t, off_t, size_t); +static int xbd_dump(void *, void *, vm_offset_t, off_t, size_t); -/* XXX move to xb_vbd.c when VBD update support is added */ +/* XXX move to xbd_vbd.c when VBD update support is added */ #define MAX_VBDS 64 #define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ @@ -140,7 +141,7 @@ static int xb_dump(void *, void *, vm_of * with blkfront as the emulated drives, easing transition slightly. */ static void -blkfront_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) +xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) { static struct vdev_info { int major; @@ -203,34 +204,34 @@ blkfront_vdevice_to_unit(uint32_t vdevic } int -xlvbd_add(struct xb_softc *sc, blkif_sector_t sectors, +xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, int vdevice, uint16_t vdisk_info, unsigned long sector_size) { - int unit, error = 0; + int unit, error = 0; const char *name; - blkfront_vdevice_to_unit(vdevice, &unit, &name); + xbd_vdevice_to_unit(vdevice, &unit, &name); - sc->xb_unit = unit; + sc->xbd_unit = unit; if (strcmp(name, "xbd")) - device_printf(sc->xb_dev, "attaching as %s%d\n", name, unit); + device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); - sc->xb_disk = disk_alloc(); - sc->xb_disk->d_unit = sc->xb_unit; - sc->xb_disk->d_open = blkif_open; - sc->xb_disk->d_close = blkif_close; - sc->xb_disk->d_ioctl = blkif_ioctl; - sc->xb_disk->d_strategy = xb_strategy; - sc->xb_disk->d_dump = xb_dump; - sc->xb_disk->d_name = name; - sc->xb_disk->d_drv1 = sc; - sc->xb_disk->d_sectorsize = sector_size; - - sc->xb_disk->d_mediasize = sectors * sector_size; - sc->xb_disk->d_maxsize = sc->max_request_size; - sc->xb_disk->d_flags = 0; - disk_create(sc->xb_disk, DISK_VERSION); + sc->xbd_disk = disk_alloc(); + sc->xbd_disk->d_unit = sc->xbd_unit; + sc->xbd_disk->d_open = xbd_open; + sc->xbd_disk->d_close = xbd_close; + sc->xbd_disk->d_ioctl = xbd_ioctl; + sc->xbd_disk->d_strategy = xbd_strategy; + sc->xbd_disk->d_dump = xbd_dump; + sc->xbd_disk->d_name = name; + sc->xbd_disk->d_drv1 = sc; + sc->xbd_disk->d_sectorsize = sector_size; + + sc->xbd_disk->d_mediasize = sectors * sector_size; + sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; + sc->xbd_disk->d_flags = 0; + disk_create(sc->xbd_disk, DISK_VERSION); return error; } @@ -242,9 +243,9 @@ xlvbd_add(struct xb_softc *sc, blkif_sec * the sortq and kick the controller. */ static void -xb_strategy(struct bio *bp) +xbd_strategy(struct bio *bp) { - struct xb_softc *sc = (struct xb_softc *)bp->bio_disk->d_drv1; + struct xbd_softc *sc = bp->bio_disk->d_drv1; /* bogus disk? */ if (sc == NULL) { @@ -258,25 +259,25 @@ xb_strategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - mtx_lock(&sc->xb_io_lock); + mtx_lock(&sc->xbd_io_lock); - xb_enqueue_bio(sc, bp); - xb_startio(sc); + xbd_enqueue_bio(sc, bp); + xbd_startio(sc); - mtx_unlock(&sc->xb_io_lock); + mtx_unlock(&sc->xbd_io_lock); return; } static void -xb_bio_complete(struct xb_softc *sc, struct xb_command *cm) +xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) { struct bio *bp; - bp = cm->bp; + bp = cm->cm_bp; - if ( unlikely(cm->status != BLKIF_RSP_OKAY) ) { + if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { disk_err(bp, "disk error" , -1, 0); - printf(" status: %x\n", cm->status); + printf(" status: %x\n", cm->cm_status); bp->bio_flags |= BIO_ERROR; } @@ -285,24 +286,24 @@ xb_bio_complete(struct xb_softc *sc, str else bp->bio_resid = 0; - xb_free_command(cm); + xbd_free_command(cm); biodone(bp); } // Quiesce the disk writes for a dump file before allowing the next buffer. static void -xb_quiesce(struct xb_softc *sc) +xbd_quiesce(struct xbd_softc *sc) { - int mtd; + int mtd; // While there are outstanding requests - while (!TAILQ_EMPTY(&sc->cm_busy)) { - RING_FINAL_CHECK_FOR_RESPONSES(&sc->ring, mtd); + while (!TAILQ_EMPTY(&sc->xbd_cm_busy)) { + RING_FINAL_CHECK_FOR_RESPONSES(&sc->xbd_ring, mtd); if (mtd) { /* Recieved request completions, update queue. */ - blkif_int(sc); + xbd_int(sc); } - if (!TAILQ_EMPTY(&sc->cm_busy)) { + if (!TAILQ_EMPTY(&sc->xbd_cm_busy)) { /* * Still pending requests, wait for the disk i/o * to complete. @@ -314,60 +315,60 @@ xb_quiesce(struct xb_softc *sc) /* Kernel dump function for a paravirtualized disk device */ static void -xb_dump_complete(struct xb_command *cm) +xbd_dump_complete(struct xbd_command *cm) { - xb_enqueue_complete(cm); + xbd_enqueue_complete(cm); } static int -xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, - size_t length) +xbd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, + size_t length) { - struct disk *dp = arg; - struct xb_softc *sc = (struct xb_softc *) dp->d_drv1; - struct xb_command *cm; - size_t chunk; - int sbp; - int rc = 0; + struct disk *dp = arg; + struct xbd_softc *sc = dp->d_drv1; + struct xbd_command *cm; + size_t chunk; + int sbp; + int rc = 0; if (length <= 0) return (rc); - xb_quiesce(sc); /* All quiet on the western front. */ + xbd_quiesce(sc); /* All quiet on the western front. */ /* * If this lock is held, then this module is failing, and a * successful kernel dump is highly unlikely anyway. */ - mtx_lock(&sc->xb_io_lock); + mtx_lock(&sc->xbd_io_lock); /* Split the 64KB block as needed */ for (sbp=0; length > 0; sbp++) { - cm = xb_dequeue_free(sc); + cm = xbd_dequeue_free(sc); if (cm == NULL) { - mtx_unlock(&sc->xb_io_lock); - device_printf(sc->xb_dev, "dump: no more commands?\n"); + mtx_unlock(&sc->xbd_io_lock); + device_printf(sc->xbd_dev, "dump: no more commands?\n"); return (EBUSY); } - if (gnttab_alloc_grant_references(sc->max_request_segments, - &cm->gref_head) != 0) { - xb_free_command(cm); - mtx_unlock(&sc->xb_io_lock); - device_printf(sc->xb_dev, "no more grant allocs?\n"); + if (gnttab_alloc_grant_references(sc->xbd_max_request_segments, + &cm->cm_gref_head) != 0) { + xbd_free_command(cm); + mtx_unlock(&sc->xbd_io_lock); + device_printf(sc->xbd_dev, "no more grant allocs?\n"); return (EBUSY); } - chunk = length > sc->max_request_size - ? sc->max_request_size : length; - cm->data = virtual; - cm->datalen = chunk; - cm->operation = BLKIF_OP_WRITE; - cm->sector_number = offset / dp->d_sectorsize; - cm->cm_complete = xb_dump_complete; + chunk = length > sc->xbd_max_request_size ? + sc->xbd_max_request_size : length; + cm->cm_data = virtual; + cm->cm_datalen = chunk; + cm->cm_operation = BLKIF_OP_WRITE; + cm->cm_sector_number = offset / dp->d_sectorsize; + cm->cm_complete = xbd_dump_complete; - xb_enqueue_ready(cm); + xbd_enqueue_ready(cm); length -= chunk; offset += chunk; @@ -375,21 +376,21 @@ xb_dump(void *arg, void *virtual, vm_off } /* Tell DOM0 to do the I/O */ - xb_startio(sc); - mtx_unlock(&sc->xb_io_lock); + xbd_startio(sc); + mtx_unlock(&sc->xbd_io_lock); /* Poll for the completion. */ - xb_quiesce(sc); /* All quite on the eastern front */ + xbd_quiesce(sc); /* All quite on the eastern front */ /* If there were any errors, bail out... */ - while ((cm = xb_dequeue_complete(sc)) != NULL) { - if (cm->status != BLKIF_RSP_OKAY) { - device_printf(sc->xb_dev, + while ((cm = xbd_dequeue_complete(sc)) != NULL) { + if (cm->cm_status != BLKIF_RSP_OKAY) { + device_printf(sc->xbd_dev, "Dump I/O failed at sector %jd\n", - cm->sector_number); + cm->cm_sector_number); rc = EIO; } - xb_free_command(cm); + xbd_free_command(cm); } return (rc); @@ -397,7 +398,7 @@ xb_dump(void *arg, void *virtual, vm_off static int -blkfront_probe(device_t dev) +xbd_probe(device_t dev) { if (!strcmp(xenbus_get_type(dev), "vbd")) { @@ -410,37 +411,35 @@ blkfront_probe(device_t dev) } static void -xb_setup_sysctl(struct xb_softc *xb) +xbd_setup_sysctl(struct xbd_softc *xbd) { struct sysctl_ctx_list *sysctl_ctx = NULL; - struct sysctl_oid *sysctl_tree = NULL; + struct sysctl_oid *sysctl_tree = NULL; - sysctl_ctx = device_get_sysctl_ctx(xb->xb_dev); + sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); if (sysctl_ctx == NULL) return; - sysctl_tree = device_get_sysctl_tree(xb->xb_dev); + sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); if (sysctl_tree == NULL) return; SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_requests", CTLFLAG_RD, &xb->max_requests, -1, - "maximum outstanding requests (negotiated)"); + "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, + "maximum outstanding requests (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_segments", CTLFLAG_RD, - &xb->max_request_segments, 0, - "maximum number of pages per requests (negotiated)"); + "max_request_segments", CTLFLAG_RD, + &xbd->xbd_max_request_segments, 0, + "maximum number of pages per requests (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_size", CTLFLAG_RD, - &xb->max_request_size, 0, - "maximum size in bytes of a request (negotiated)"); + "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "ring_pages", CTLFLAG_RD, - &xb->ring_pages, 0, - "communication channel pages (negotiated)"); + "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, + "communication channel pages (negotiated)"); } /* @@ -449,9 +448,9 @@ xb_setup_sysctl(struct xb_softc *xb) * ok. */ static int -blkfront_attach(device_t dev) +xbd_attach(device_t dev) { - struct xb_softc *sc; + struct xbd_softc *sc; const char *name; uint32_t vdevice; int error; @@ -467,25 +466,25 @@ blkfront_attach(device_t dev) return (error); } - blkfront_vdevice_to_unit(vdevice, &unit, &name); + xbd_vdevice_to_unit(vdevice, &unit, &name); if (!strcmp(name, "xbd")) device_set_unit(dev, unit); sc = device_get_softc(dev); - mtx_init(&sc->xb_io_lock, "blkfront i/o lock", NULL, MTX_DEF); - xb_initq_free(sc); - xb_initq_busy(sc); - xb_initq_ready(sc); - xb_initq_complete(sc); - xb_initq_bio(sc); - for (i = 0; i < XBF_MAX_RING_PAGES; i++) - sc->ring_ref[i] = GRANT_INVALID_REF; - - sc->xb_dev = dev; - sc->vdevice = vdevice; - sc->connected = BLKIF_STATE_DISCONNECTED; + mtx_init(&sc->xbd_io_lock, "blkfront i/o lock", NULL, MTX_DEF); + xbd_initq_free(sc); + xbd_initq_busy(sc); + xbd_initq_ready(sc); + xbd_initq_complete(sc); + xbd_initq_bio(sc); + for (i = 0; i < XBD_MAX_RING_PAGES; i++) + sc->xbd_ring_ref[i] = GRANT_INVALID_REF; + + sc->xbd_dev = dev; + sc->xbd_vdevice = vdevice; + sc->xbd_connected = XBD_STATE_DISCONNECTED; - xb_setup_sysctl(sc); + xbd_setup_sysctl(sc); /* Wait for backend device to publish its protocol capabilities. */ xenbus_set_state(dev, XenbusStateInitialising); @@ -494,48 +493,48 @@ blkfront_attach(device_t dev) } static int -blkfront_suspend(device_t dev) +xbd_suspend(device_t dev) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); int retval; int saved_state; /* Prevent new requests being issued until we fix things up. */ - mtx_lock(&sc->xb_io_lock); - saved_state = sc->connected; - sc->connected = BLKIF_STATE_SUSPENDED; + mtx_lock(&sc->xbd_io_lock); + saved_state = sc->xbd_connected; + sc->xbd_connected = XBD_STATE_SUSPENDED; /* Wait for outstanding I/O to drain. */ retval = 0; - while (TAILQ_EMPTY(&sc->cm_busy) == 0) { - if (msleep(&sc->cm_busy, &sc->xb_io_lock, - PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { + while (TAILQ_EMPTY(&sc->xbd_cm_busy) == 0) { + if (msleep(&sc->xbd_cm_busy, &sc->xbd_io_lock, + PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { retval = EBUSY; break; } } - mtx_unlock(&sc->xb_io_lock); + mtx_unlock(&sc->xbd_io_lock); if (retval != 0) - sc->connected = saved_state; + sc->xbd_connected = saved_state; return (retval); } static int -blkfront_resume(device_t dev) +xbd_resume(device_t dev) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); - DPRINTK("blkfront_resume: %s\n", xenbus_get_node(dev)); + DPRINTK("xbd_resume: %s\n", xenbus_get_node(dev)); - blkif_free(sc); - blkfront_initialize(sc); + xbd_free(sc); + xbd_initialize(sc); return (0); } static void -blkfront_initialize(struct xb_softc *sc) +xbd_initialize(struct xbd_softc *sc) { const char *otherend_path; const char *node_path; @@ -543,7 +542,7 @@ blkfront_initialize(struct xb_softc *sc) int error; int i; - if (xenbus_get_state(sc->xb_dev) != XenbusStateInitialising) { + if (xenbus_get_state(sc->xbd_dev) != XenbusStateInitialising) { /* Initialization has already been performed. */ return; } @@ -553,10 +552,12 @@ blkfront_initialize(struct xb_softc *sc) * setting fails. */ max_ring_page_order = 0; - sc->ring_pages = 1; - sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->max_request_size = XBF_SEGS_TO_SIZE(sc->max_request_segments); - sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); + sc->xbd_ring_pages = 1; + sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; + sc->xbd_max_request_size = + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); + sc->xbd_max_request_blocks = + BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); /* * Protocol negotiation. @@ -569,266 +570,279 @@ blkfront_initialize(struct xb_softc *sc) * \note xs_scanf() does not update variables for unmatched * fields. */ - otherend_path = xenbus_get_otherend_path(sc->xb_dev); - node_path = xenbus_get_node(sc->xb_dev); + otherend_path = xenbus_get_otherend_path(sc->xbd_dev); + node_path = xenbus_get_node(sc->xbd_dev); /* Support both backend schemes for relaying ring page limits. */ (void)xs_scanf(XST_NIL, otherend_path, - "max-ring-page-order", NULL, "%" PRIu32, - &max_ring_page_order); - sc->ring_pages = 1 << max_ring_page_order; + "max-ring-page-order", NULL, "%" PRIu32, + &max_ring_page_order); + sc->xbd_ring_pages = 1 << max_ring_page_order; (void)xs_scanf(XST_NIL, otherend_path, - "max-ring-pages", NULL, "%" PRIu32, - &sc->ring_pages); - if (sc->ring_pages < 1) - sc->ring_pages = 1; + "max-ring-pages", NULL, "%" PRIu32, + &sc->xbd_ring_pages); + if (sc->xbd_ring_pages < 1) + sc->xbd_ring_pages = 1; - sc->max_requests = BLKIF_MAX_RING_REQUESTS(sc->ring_pages * PAGE_SIZE); + sc->xbd_max_requests = + BLKIF_MAX_RING_REQUESTS(sc->xbd_ring_pages * PAGE_SIZE); (void)xs_scanf(XST_NIL, otherend_path, - "max-requests", NULL, "%" PRIu32, - &sc->max_requests); + "max-requests", NULL, "%" PRIu32, + &sc->xbd_max_requests); (void)xs_scanf(XST_NIL, otherend_path, - "max-request-segments", NULL, "%" PRIu32, - &sc->max_request_segments); + "max-request-segments", NULL, "%" PRIu32, + &sc->xbd_max_request_segments); (void)xs_scanf(XST_NIL, otherend_path, - "max-request-size", NULL, "%" PRIu32, - &sc->max_request_size); + "max-request-size", NULL, "%" PRIu32, + &sc->xbd_max_request_size); - if (sc->ring_pages > XBF_MAX_RING_PAGES) { - device_printf(sc->xb_dev, "Back-end specified ring-pages of " - "%u limited to front-end limit of %zu.\n", - sc->ring_pages, XBF_MAX_RING_PAGES); - sc->ring_pages = XBF_MAX_RING_PAGES; + if (sc->xbd_ring_pages > XBD_MAX_RING_PAGES) { + device_printf(sc->xbd_dev, + "Back-end specified ring-pages of %u " + "limited to front-end limit of %zu.\n", + sc->xbd_ring_pages, XBD_MAX_RING_PAGES); + sc->xbd_ring_pages = XBD_MAX_RING_PAGES; } - if (powerof2(sc->ring_pages) == 0) { + if (powerof2(sc->xbd_ring_pages) == 0) { uint32_t new_page_limit; - new_page_limit = 0x01 << (fls(sc->ring_pages) - 1); - device_printf(sc->xb_dev, "Back-end specified ring-pages of " - "%u is not a power of 2. Limited to %u.\n", - sc->ring_pages, new_page_limit); - sc->ring_pages = new_page_limit; - } - - if (sc->max_requests > XBF_MAX_REQUESTS) { - device_printf(sc->xb_dev, "Back-end specified max_requests of " - "%u limited to front-end limit of %u.\n", - sc->max_requests, XBF_MAX_REQUESTS); - sc->max_requests = XBF_MAX_REQUESTS; - } - - if (sc->max_request_segments > XBF_MAX_SEGMENTS_PER_REQUEST) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_segments of %u limited to " - "front-end limit of %u.\n", - sc->max_request_segments, - XBF_MAX_SEGMENTS_PER_REQUEST); - sc->max_request_segments = XBF_MAX_SEGMENTS_PER_REQUEST; - } - - if (sc->max_request_size > XBF_MAX_REQUEST_SIZE) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_size of %u limited to front-end " - "limit of %u.\n", sc->max_request_size, - XBF_MAX_REQUEST_SIZE); - sc->max_request_size = XBF_MAX_REQUEST_SIZE; + new_page_limit = 0x01 << (fls(sc->xbd_ring_pages) - 1); + device_printf(sc->xbd_dev, + "Back-end specified ring-pages of %u " + "is not a power of 2. Limited to %u.\n", + sc->xbd_ring_pages, new_page_limit); + sc->xbd_ring_pages = new_page_limit; + } + + if (sc->xbd_max_requests > XBD_MAX_REQUESTS) { + device_printf(sc->xbd_dev, + "Back-end specified max_requests of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_requests, XBD_MAX_REQUESTS); + sc->xbd_max_requests = XBD_MAX_REQUESTS; + } + + if (sc->xbd_max_request_segments > XBD_MAX_SEGMENTS_PER_REQUEST) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_segments of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_request_segments, + XBD_MAX_SEGMENTS_PER_REQUEST); + sc->xbd_max_request_segments = XBD_MAX_SEGMENTS_PER_REQUEST; + } + + if (sc->xbd_max_request_size > XBD_MAX_REQUEST_SIZE) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_size of %u " + "limited to front-end limit of %u.\n", + sc->xbd_max_request_size, + XBD_MAX_REQUEST_SIZE); + sc->xbd_max_request_size = XBD_MAX_REQUEST_SIZE; } - if (sc->max_request_size > XBF_SEGS_TO_SIZE(sc->max_request_segments)) { - device_printf(sc->xb_dev, "Back-end specified " - "max_request_size of %u limited to front-end " - "limit of %u. (Too few segments.)\n", - sc->max_request_size, - XBF_SEGS_TO_SIZE(sc->max_request_segments)); - sc->max_request_size = - XBF_SEGS_TO_SIZE(sc->max_request_segments); + if (sc->xbd_max_request_size > + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments)) { + device_printf(sc->xbd_dev, + "Back-end specified max_request_size of %u " + "limited to front-end limit of %u. (Too few segments.)\n", + sc->xbd_max_request_size, + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments)); + sc->xbd_max_request_size = + XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); } - sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); + sc->xbd_max_request_blocks = + BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); /* Allocate datastructures based on negotiated values. */ - error = bus_dma_tag_create(bus_get_dma_tag(sc->xb_dev), /* parent */ - 512, PAGE_SIZE, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sc->max_request_size, - sc->max_request_segments, - PAGE_SIZE, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &sc->xb_io_lock, /* lockarg */ - &sc->xb_io_dmat); + error = bus_dma_tag_create( + bus_get_dma_tag(sc->xbd_dev), /* parent */ + 512, PAGE_SIZE, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sc->xbd_max_request_size, + sc->xbd_max_request_segments, + PAGE_SIZE, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->xbd_io_lock, /* lockarg */ + &sc->xbd_io_dmat); if (error != 0) { - xenbus_dev_fatal(sc->xb_dev, error, - "Cannot allocate parent DMA tag\n"); + xenbus_dev_fatal(sc->xbd_dev, error, + "Cannot allocate parent DMA tag\n"); return; } /* Per-transaction data allocation. */ - sc->shadow = malloc(sizeof(*sc->shadow) * sc->max_requests, - M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); - if (sc->shadow == NULL) { - bus_dma_tag_destroy(sc->xb_io_dmat); - xenbus_dev_fatal(sc->xb_dev, error, - "Cannot allocate request structures\n"); + sc->xbd_shadow = malloc(sizeof(*sc->xbd_shadow) * sc->xbd_max_requests, + M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); + if (sc->xbd_shadow == NULL) { + bus_dma_tag_destroy(sc->xbd_io_dmat); + xenbus_dev_fatal(sc->xbd_dev, error, + "Cannot allocate request structures\n"); return; } - for (i = 0; i < sc->max_requests; i++) { - struct xb_command *cm; + for (i = 0; i < sc->xbd_max_requests; i++) { + struct xbd_command *cm; - cm = &sc->shadow[i]; - cm->sg_refs = malloc(sizeof(grant_ref_t) - * sc->max_request_segments, - M_XENBLOCKFRONT, M_NOWAIT); - if (cm->sg_refs == NULL) + cm = &sc->xbd_shadow[i]; + cm->cm_sg_refs = malloc( + sizeof(grant_ref_t) * sc->xbd_max_request_segments, + M_XENBLOCKFRONT, M_NOWAIT); + if (cm->cm_sg_refs == NULL) break; - cm->id = i; + cm->cm_id = i; cm->cm_sc = sc; - if (bus_dmamap_create(sc->xb_io_dmat, 0, &cm->map) != 0) + if (bus_dmamap_create(sc->xbd_io_dmat, 0, &cm->cm_map) != 0) break; - xb_free_command(cm); + xbd_free_command(cm); } - if (setup_blkring(sc) != 0) + if (xbd_setup_ring(sc) != 0) return; /* Support both backend schemes for relaying ring page limits. */ - if (sc->ring_pages > 1) { + if (sc->xbd_ring_pages > 1) { error = xs_printf(XST_NIL, node_path, - "num-ring-pages","%u", sc->ring_pages); + "num-ring-pages","%u", + sc->xbd_ring_pages); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/num-ring-pages", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/num-ring-pages", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "ring-page-order", "%u", - fls(sc->ring_pages) - 1); + "ring-page-order", "%u", + fls(sc->xbd_ring_pages) - 1); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-page-order", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-page-order", + node_path); return; } } error = xs_printf(XST_NIL, node_path, - "max-requests","%u", sc->max_requests); + "max-requests","%u", + sc->xbd_max_requests); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-requests", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-requests", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "max-request-segments","%u", sc->max_request_segments); + "max-request-segments","%u", + sc->xbd_max_request_segments); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-request-segments", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-request-segments", + node_path); return; } error = xs_printf(XST_NIL, node_path, - "max-request-size","%u", sc->max_request_size); + "max-request-size","%u", + sc->xbd_max_request_size); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/max-request-size", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/max-request-size", + node_path); return; } error = xs_printf(XST_NIL, node_path, "event-channel", - "%u", irq_to_evtchn_port(sc->irq)); + "%u", irq_to_evtchn_port(sc->xbd_irq)); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/event-channel", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/event-channel", + node_path); return; } - error = xs_printf(XST_NIL, node_path, - "protocol", "%s", XEN_IO_PROTO_ABI_NATIVE); + error = xs_printf(XST_NIL, node_path, "protocol", + "%s", XEN_IO_PROTO_ABI_NATIVE); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/protocol", - node_path); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/protocol", + node_path); return; } - xenbus_set_state(sc->xb_dev, XenbusStateInitialised); + xenbus_set_state(sc->xbd_dev, XenbusStateInitialised); } static int -setup_blkring(struct xb_softc *sc) +xbd_setup_ring(struct xbd_softc *sc) { blkif_sring_t *sring; uintptr_t sring_page_addr; int error; int i; - sring = malloc(sc->ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, - M_NOWAIT|M_ZERO); + sring = malloc(sc->xbd_ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, + M_NOWAIT|M_ZERO); if (sring == NULL) { - xenbus_dev_fatal(sc->xb_dev, ENOMEM, "allocating shared ring"); + xenbus_dev_fatal(sc->xbd_dev, ENOMEM, "allocating shared ring"); return (ENOMEM); } SHARED_RING_INIT(sring); - FRONT_RING_INIT(&sc->ring, sring, sc->ring_pages * PAGE_SIZE); + FRONT_RING_INIT(&sc->xbd_ring, sring, sc->xbd_ring_pages * PAGE_SIZE); for (i = 0, sring_page_addr = (uintptr_t)sring; - i < sc->ring_pages; + i < sc->xbd_ring_pages; i++, sring_page_addr += PAGE_SIZE) { - error = xenbus_grant_ring(sc->xb_dev, - (vtomach(sring_page_addr) >> PAGE_SHIFT), &sc->ring_ref[i]); + error = xenbus_grant_ring(sc->xbd_dev, + (vtomach(sring_page_addr) >> PAGE_SHIFT), + &sc->xbd_ring_ref[i]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "granting ring_ref(%d)", i); + xenbus_dev_fatal(sc->xbd_dev, error, + "granting ring_ref(%d)", i); return (error); } } - if (sc->ring_pages == 1) { - error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - "ring-ref", "%u", sc->ring_ref[0]); + if (sc->xbd_ring_pages == 1) { + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + "ring-ref", "%u", sc->xbd_ring_ref[0]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-ref", - xenbus_get_node(sc->xb_dev)); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-ref", + xenbus_get_node(sc->xbd_dev)); return (error); } } else { - for (i = 0; i < sc->ring_pages; i++) { + for (i = 0; i < sc->xbd_ring_pages; i++) { char ring_ref_name[]= "ring_refXX"; snprintf(ring_ref_name, sizeof(ring_ref_name), - "ring-ref%u", i); - error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - ring_ref_name, "%u", sc->ring_ref[i]); + "ring-ref%u", i); + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + ring_ref_name, "%u", sc->xbd_ring_ref[i]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/%s", - xenbus_get_node(sc->xb_dev), - ring_ref_name); + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/%s", + xenbus_get_node(sc->xbd_dev), + ring_ref_name); return (error); } } } error = bind_listening_port_to_irqhandler( - xenbus_get_otherend_id(sc->xb_dev), - "xbd", (driver_intr_t *)blkif_int, sc, - INTR_TYPE_BIO | INTR_MPSAFE, &sc->irq); + xenbus_get_otherend_id(sc->xbd_dev), + "xbd", (driver_intr_t *)xbd_int, sc, + INTR_TYPE_BIO | INTR_MPSAFE, &sc->xbd_irq); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, + xenbus_dev_fatal(sc->xbd_dev, error, "bind_evtchn_to_irqhandler failed"); return (error); } @@ -840,9 +854,9 @@ setup_blkring(struct xb_softc *sc) * Callback received when the backend's state changes. */ static void -blkfront_backend_changed(device_t dev, XenbusState backend_state) +xbd_backend_changed(device_t dev, XenbusState backend_state) { - struct xb_softc *sc = device_get_softc(dev); + struct xbd_softc *sc = device_get_softc(dev); DPRINTK("backend_state=%d\n", backend_state); @@ -856,47 +870,47 @@ blkfront_backend_changed(device_t dev, X *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 31 21:25:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A100FC4E; Fri, 31 May 2013 21:25:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91D5BDB0; Fri, 31 May 2013 21:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLPpng071506; Fri, 31 May 2013 21:25:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLPppF071505; Fri, 31 May 2013 21:25:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312125.r4VLPppF071505@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 21:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251196 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 21:25:51 -0000 Author: jilles Date: Fri May 31 21:25:51 2013 New Revision: 251196 URL: http://svnweb.freebsd.org/changeset/base/251196 Log: sigaction(2): Extend description of async-signal safe functions: * Improve description when unsafe functions are unsafe. * Add various safe functions from POSIX.1-2008 and Austin Group issue #692. Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Fri May 31 21:05:07 2013 (r251195) +++ head/lib/libc/sys/sigaction.2 Fri May 31 21:25:51 2013 (r251196) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd September 27, 2012 +.Dd May 31, 2013 .Dt SIGACTION 2 .Os .Sh NAME @@ -346,13 +346,19 @@ Any attempt to do so will be silently ig The following functions are either reentrant or not interruptible by signals and are async-signal safe. Therefore applications may -invoke them, without restriction, from signal-catching functions: +invoke them, without restriction, from signal-catching functions +or from a child process after calling +.Xr fork 2 +in a multi-threaded process: .Pp Base Interfaces: .Pp +.Fn _Exit , .Fn _exit , +.Fn accept , .Fn access , .Fn alarm , +.Fn bind , .Fn cfgetispeed , .Fn cfgetospeed , .Fn cfsetispeed , @@ -361,41 +367,65 @@ Base Interfaces: .Fn chmod , .Fn chown , .Fn close , +.Fn connect , .Fn creat , .Fn dup , .Fn dup2 , +.Fn execl , .Fn execle , +.Fn execv , .Fn execve , +.Fn fchdir , +.Fn fchmod , +.Fn fchown , .Fn fcntl , .Fn fork , -.Fn fpathconf , .Fn fstat , .Fn fsync , +.Fn ftruncate , .Fn getegid , .Fn geteuid , .Fn getgid , .Fn getgroups , +.Fn getpeername , .Fn getpgrp , .Fn getpid , .Fn getppid , +.Fn getsockname , +.Fn getsockopt , .Fn getuid , .Fn kill , .Fn link , +.Fn listen , .Fn lseek , +.Fn lstat , .Fn mkdir , .Fn mkfifo , +.Fn mknod , .Fn open , -.Fn pathconf , .Fn pause , .Fn pipe , +.Fn poll , +.Fn pselect , +.Fn pthread_sigmask , .Fn raise , .Fn read , +.Fn readlink , +.Fn recv , +.Fn recvfrom , +.Fn recvmsg , .Fn rename , .Fn rmdir , +.Fn select , +.Fn send , +.Fn sendmsg , +.Fn sendto , .Fn setgid , .Fn setpgid , .Fn setsid , +.Fn setsockopt , .Fn setuid , +.Fn shutdown , .Fn sigaction , .Fn sigaddset , .Fn sigdelset , @@ -407,8 +437,11 @@ Base Interfaces: .Fn sigprocmask , .Fn sigsuspend , .Fn sleep , +.Fn sockatmark , +.Fn socket , +.Fn socketpair , .Fn stat , -.Fn sysconf , +.Fn symlink , .Fn tcdrain , .Fn tcflow , .Fn tcflush , @@ -427,11 +460,16 @@ Base Interfaces: .Fn waitpid , .Fn write . .Pp +X/Open Systems Interfaces: +.Pp +.Fn sigpause , +.Fn sigset , +.Fn utimes . +.Pp Realtime Interfaces: .Pp .Fn aio_error , .Fn clock_gettime , -.Fn sigpause , .Fn timer_getoverrun , .Fn aio_return , .Fn fdatasync , @@ -439,27 +477,84 @@ Realtime Interfaces: .Fn timer_gettime , .Fn aio_suspend , .Fn sem_post , -.Fn sigset , .Fn timer_settime . .Pp -.Tn ANSI C -Interfaces: +Base Interfaces not specified as async-signal safe by +.Tn POSIX : .Pp -.Fn strcpy , +.Fn fpathconf , +.Fn pathconf , +.Fn sysconf . +.Pp +Base Interfaces not specified as async-signal safe by +.Tn POSIX , +but planned to be: +.Pp +.Fn ffs , +.Fn htonl , +.Fn htons , +.Fn memccpy , +.Fn memchr , +.Fn memcmp , +.Fn memcpy , +.Fn memmove , +.Fn memset , +.Fn ntohl , +.Fn ntohs , +.Fn stpcpy , +.Fn stpncpy , .Fn strcat , -.Fn strncpy , +.Fn strchr , +.Fn strcmp , +.Fn strcpy , +.Fn strcspn , +.Fn strlen , .Fn strncat , -and perhaps some others. +.Fn strncmp , +.Fn strncpy , +.Fn strnlen , +.Fn strpbrk , +.Fn strrchr , +.Fn strspn , +.Fn strstr , +.Fn strtok_r , +.Fn wcpcpy , +.Fn wcpncpy , +.Fn wcscat , +.Fn wcschr , +.Fn wcscmp , +.Fn wcscpy , +.Fn wcscspn , +.Fn wcslen , +.Fn wcsncat , +.Fn wcsncmp , +.Fn wcsncpy , +.Fn wcsnlen , +.Fn wcspbrk , +.Fn wcsrchr , +.Fn wcsspn , +.Fn wcsstr , +.Fn wcstok , +.Fn wmemchr , +.Fn wmemcmp , +.Fn wmemcpy , +.Fn wmemmove , +.Fn wmemset . .Pp Extension Interfaces: .Pp .Fn strlcpy , .Fn strlcat . .Pp +In addition, reading or writing +.Va errno +is async-signal safe. +.Pp All functions not in the above lists are considered to be unsafe with respect to signals. That is to say, the behaviour of such -functions when called from a signal handler is undefined. +functions is undefined when they are called from a signal handler +that interrupted an unsafe function. In general though, signal handlers should do little more than set a flag; most other actions are not safe. .Pp From owner-svn-src-head@FreeBSD.ORG Fri May 31 21:31:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CABD6EC8; Fri, 31 May 2013 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB30ADF0; Fri, 31 May 2013 21:31:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLVcqr074133; Fri, 31 May 2013 21:31:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLVcd5074132; Fri, 31 May 2013 21:31:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312131.r4VLVcd5074132@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 21:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251197 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 21:31:38 -0000 Author: jilles Date: Fri May 31 21:31:38 2013 New Revision: 251197 URL: http://svnweb.freebsd.org/changeset/base/251197 Log: sigaction(2): *at system calls are async-signal safe. Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Fri May 31 21:25:51 2013 (r251196) +++ head/lib/libc/sys/sigaction.2 Fri May 31 21:31:38 2013 (r251197) @@ -375,12 +375,16 @@ Base Interfaces: .Fn execle , .Fn execv , .Fn execve , +.Fn faccessat , .Fn fchdir , .Fn fchmod , +.Fn fchmodat , .Fn fchown , +.Fn fchownat , .Fn fcntl , .Fn fork , .Fn fstat , +.Fn fstatat , .Fn fsync , .Fn ftruncate , .Fn getegid , @@ -396,13 +400,18 @@ Base Interfaces: .Fn getuid , .Fn kill , .Fn link , +.Fn linkat , .Fn listen , .Fn lseek , .Fn lstat , .Fn mkdir , +.Fn mkdirat , .Fn mkfifo , +.Fn mkfifoat , .Fn mknod , +.Fn mknodat , .Fn open , +.Fn openat , .Fn pause , .Fn pipe , .Fn poll , @@ -411,10 +420,12 @@ Base Interfaces: .Fn raise , .Fn read , .Fn readlink , +.Fn readlinkat , .Fn recv , .Fn recvfrom , .Fn recvmsg , .Fn rename , +.Fn renameat , .Fn rmdir , .Fn select , .Fn send , @@ -442,6 +453,7 @@ Base Interfaces: .Fn socketpair , .Fn stat , .Fn symlink , +.Fn symlinkat , .Fn tcdrain , .Fn tcflow , .Fn tcflush , @@ -455,6 +467,7 @@ Base Interfaces: .Fn umask , .Fn uname , .Fn unlink , +.Fn unlinkat , .Fn utime , .Fn wait , .Fn waitpid , @@ -543,6 +556,7 @@ but planned to be: .Pp Extension Interfaces: .Pp +.Fn futimesat , .Fn strlcpy , .Fn strlcat . .Pp From owner-svn-src-head@FreeBSD.ORG Fri May 31 21:43:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C05C23F; Fri, 31 May 2013 21:43:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CECAE32; Fri, 31 May 2013 21:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLhIfu077973; Fri, 31 May 2013 21:43:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLhIAr077972; Fri, 31 May 2013 21:43:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201305312143.r4VLhIAr077972@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 31 May 2013 21:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251198 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 21:43:18 -0000 Author: obrien Date: Fri May 31 21:43:17 2013 New Revision: 251198 URL: http://svnweb.freebsd.org/changeset/base/251198 Log: Add a "kern.features" MIB for 32bit support under a 64bit kernel. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri May 31 21:31:38 2013 (r251197) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri May 31 21:43:17 2013 (r251198) @@ -104,6 +104,8 @@ __FBSDID("$FreeBSD$"); #include #include +FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD"); + #ifndef __mips__ CTASSERT(sizeof(struct timeval32) == 8); CTASSERT(sizeof(struct timespec32) == 8); From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:09:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7282BB9A; Fri, 31 May 2013 22:09:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63824EFF; Fri, 31 May 2013 22:09:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VM9W8M086297; Fri, 31 May 2013 22:09:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VM9WJ7086296; Fri, 31 May 2013 22:09:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312209.r4VM9WJ7086296@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251203 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:09:32 -0000 Author: jilles Date: Fri May 31 22:09:31 2013 New Revision: 251203 URL: http://svnweb.freebsd.org/changeset/base/251203 Log: dup(2): Clarify return value, in particular of dup2(). Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Fri May 31 22:08:25 2013 (r251202) +++ head/lib/libc/sys/dup.2 Fri May 31 22:09:31 2013 (r251203) @@ -28,7 +28,7 @@ .\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd June 1, 2013 .Dt DUP 2 .Os .Sh NAME @@ -113,10 +113,11 @@ is a valid descriptor, then .Fn dup2 is successful, and does nothing. .Sh RETURN VALUES -The value -1 is returned if an error occurs in either call. -The external variable +These calls return the new file descriptor if successful; +otherwise the value -1 is returned and +the external variable .Va errno -indicates the cause of the error. +is set to indicate the cause of the error. .Sh ERRORS The .Fn dup From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:21:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 58E08EB5; Fri, 31 May 2013 22:21:38 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AB91F42; Fri, 31 May 2013 22:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMLcn4091944; Fri, 31 May 2013 22:21:38 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMLcwv091943; Fri, 31 May 2013 22:21:38 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312221.r4VMLcwv091943@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 22:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251204 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:21:38 -0000 Author: gibbs Date: Fri May 31 22:21:37 2013 New Revision: 251204 URL: http://svnweb.freebsd.org/changeset/base/251204 Log: Style cleanups. No intended functional changes. o Group functions by by their functionality. o Remove superfluous declarations. o Remove more unused (#ifdef'd out) code. Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:09:31 2013 (r251203) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:21:37 2013 (r251204) @@ -70,20 +70,22 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -/* prototypes */ -static void xbd_free_command(struct xbd_command *cm); -static void xbd_startio(struct xbd_softc *sc); -static void xbd_connect(struct xbd_softc *); +/*--------------------------- Forward Declarations ---------------------------*/ static void xbd_closing(device_t); -static int xbd_detach(device_t); -static int xbd_setup_ring(struct xbd_softc *); -static void xbd_int(void *); -static void xbd_initialize(struct xbd_softc *); -static int xbd_completion(struct xbd_command *); -static void xbd_free(struct xbd_softc *); -static void xbd_queue_cb(void *, bus_dma_segment_t *, int, int); +static void xbd_startio(struct xbd_softc *sc); -static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); +/*---------------------------------- Macros ----------------------------------*/ +#if 0 +#define DPRINTK(fmt, args...) printf("[XEN] %s:%d: " fmt ".\n", __func__, __LINE__, ##args) +#else +#define DPRINTK(fmt, args...) +#endif + +/* XXX move to xbd_vbd.c when VBD update support is added */ +#define MAX_VBDS 64 + +#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ +#define XBD_SECTOR_SHFT 9 #define GRANT_INVALID_REF 0 @@ -98,199 +100,361 @@ static void vbd_update(void); #define XBD_STATE_CONNECTED 1 #define XBD_STATE_SUSPENDED 2 -#ifdef notyet -static char *xbd_state_name[] = { - [XBD_STATE_DISCONNECTED] = "disconnected", - [XBD_STATE_CONNECTED] = "connected", - [XBD_STATE_SUSPENDED] = "closed", -}; - -static char * xbd_status_name[] = { - [BLKIF_INTERFACE_STATUS_CLOSED] = "closed", - [BLKIF_INTERFACE_STATUS_DISCONNECTED] = "disconnected", - [BLKIF_INTERFACE_STATUS_CONNECTED] = "connected", - [BLKIF_INTERFACE_STATUS_CHANGED] = "changed", -}; -#endif - -#if 0 -#define DPRINTK(fmt, args...) printf("[XEN] %s:%d: " fmt ".\n", __func__, __LINE__, ##args) -#else -#define DPRINTK(fmt, args...) -#endif +/*---------------------------- Global Static Data ----------------------------*/ +static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); -static int xbd_open(struct disk *dp); -static int xbd_close(struct disk *dp); -static int xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); -static int xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm); -static void xbd_strategy(struct bio *bp); - -// In order to quiesce the device during kernel dumps, outstanding requests to -// DOM0 for disk reads/writes need to be accounted for. -static int xbd_dump(void *, void *, vm_offset_t, off_t, size_t); +/*---------------------------- Command Processing ----------------------------*/ +static inline void +flush_requests(struct xbd_softc *sc) +{ + int notify; -/* XXX move to xbd_vbd.c when VBD update support is added */ -#define MAX_VBDS 64 + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->xbd_ring, notify); -#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ -#define XBD_SECTOR_SHFT 9 + if (notify) + notify_remote_via_irq(sc->xbd_irq); +} -/* - * Translate Linux major/minor to an appropriate name and unit - * number. For HVM guests, this allows us to use the same drive names - * with blkfront as the emulated drives, easing transition slightly. - */ static void -xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) +xbd_free_command(struct xbd_command *cm) { - static struct vdev_info { - int major; - int shift; - int base; - const char *name; - } info[] = { - {3, 6, 0, "ada"}, /* ide0 */ - {22, 6, 2, "ada"}, /* ide1 */ - {33, 6, 4, "ada"}, /* ide2 */ - {34, 6, 6, "ada"}, /* ide3 */ - {56, 6, 8, "ada"}, /* ide4 */ - {57, 6, 10, "ada"}, /* ide5 */ - {88, 6, 12, "ada"}, /* ide6 */ - {89, 6, 14, "ada"}, /* ide7 */ - {90, 6, 16, "ada"}, /* ide8 */ - {91, 6, 18, "ada"}, /* ide9 */ - {8, 4, 0, "da"}, /* scsi disk0 */ - {65, 4, 16, "da"}, /* scsi disk1 */ - {66, 4, 32, "da"}, /* scsi disk2 */ - {67, 4, 48, "da"}, /* scsi disk3 */ - {68, 4, 64, "da"}, /* scsi disk4 */ - {69, 4, 80, "da"}, /* scsi disk5 */ - {70, 4, 96, "da"}, /* scsi disk6 */ - {71, 4, 112, "da"}, /* scsi disk7 */ - {128, 4, 128, "da"}, /* scsi disk8 */ - {129, 4, 144, "da"}, /* scsi disk9 */ - {130, 4, 160, "da"}, /* scsi disk10 */ - {131, 4, 176, "da"}, /* scsi disk11 */ - {132, 4, 192, "da"}, /* scsi disk12 */ - {133, 4, 208, "da"}, /* scsi disk13 */ - {134, 4, 224, "da"}, /* scsi disk14 */ - {135, 4, 240, "da"}, /* scsi disk15 */ + KASSERT((cm->cm_flags & XBD_ON_XBDQ_MASK) == 0, + ("Freeing command that is still on a queue\n")); - {202, 4, 0, "xbd"}, /* xbd */ + cm->cm_flags = 0; + cm->cm_bp = NULL; + cm->cm_complete = NULL; + xbd_enqueue_free(cm); +} - {0, 0, 0, NULL}, - }; - int major = vdevice >> 8; - int minor = vdevice & 0xff; - int i; +static void +xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct xbd_softc *sc; + struct xbd_command *cm; + blkif_request_t *ring_req; + struct blkif_request_segment *sg; + struct blkif_request_segment *last_block_sg; + grant_ref_t *sg_ref; + vm_paddr_t buffer_ma; + uint64_t fsect, lsect; + int ref; + int op; + int block_segs; - if (vdevice & (1 << 28)) { - *unit = (vdevice & ((1 << 28) - 1)) >> 8; - *name = "xbd"; + cm = arg; + sc = cm->cm_sc; + + if (error) { + printf("error %d in xbd_queue_cb\n", error); + cm->cm_bp->bio_error = EIO; + biodone(cm->cm_bp); + xbd_free_command(cm); return; } - for (i = 0; info[i].major; i++) { - if (info[i].major == major) { - *unit = info[i].base + (minor >> info[i].shift); - *name = info[i].name; - return; - } - } + /* Fill out a communications ring structure. */ + ring_req = RING_GET_REQUEST(&sc->xbd_ring, sc->xbd_ring.req_prod_pvt); + sc->xbd_ring.req_prod_pvt++; + ring_req->id = cm->cm_id; + ring_req->operation = cm->cm_operation; + ring_req->sector_number = cm->cm_sector_number; + ring_req->handle = (blkif_vdev_t)(uintptr_t)sc->xbd_disk; + ring_req->nr_segments = nsegs; + cm->cm_nseg = nsegs; - *unit = minor >> 4; - *name = "xbd"; -} + block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK); + sg = ring_req->seg; + last_block_sg = sg + block_segs; + sg_ref = cm->cm_sg_refs; -int -xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, - int vdevice, uint16_t vdisk_info, unsigned long sector_size) -{ - int unit, error = 0; - const char *name; + while (1) { - xbd_vdevice_to_unit(vdevice, &unit, &name); + while (sg < last_block_sg) { + buffer_ma = segs->ds_addr; + fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; + lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; - sc->xbd_unit = unit; + KASSERT(lsect <= 7, ("XEN disk driver data cannot " + "cross a page boundary")); - if (strcmp(name, "xbd")) - device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); + /* install a grant reference. */ + ref = gnttab_claim_grant_reference(&cm->cm_gref_head); - sc->xbd_disk = disk_alloc(); - sc->xbd_disk->d_unit = sc->xbd_unit; - sc->xbd_disk->d_open = xbd_open; - sc->xbd_disk->d_close = xbd_close; - sc->xbd_disk->d_ioctl = xbd_ioctl; - sc->xbd_disk->d_strategy = xbd_strategy; - sc->xbd_disk->d_dump = xbd_dump; - sc->xbd_disk->d_name = name; - sc->xbd_disk->d_drv1 = sc; - sc->xbd_disk->d_sectorsize = sector_size; + /* + * GNTTAB_LIST_END == 0xffffffff, but it is private + * to gnttab.c. + */ + KASSERT(ref != ~0, ("grant_reference failed")); - sc->xbd_disk->d_mediasize = sectors * sector_size; - sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = 0; - disk_create(sc->xbd_disk, DISK_VERSION); + gnttab_grant_foreign_access_ref( + ref, + xenbus_get_otherend_id(sc->xbd_dev), + buffer_ma >> PAGE_SHIFT, + ring_req->operation == BLKIF_OP_WRITE); - return error; -} + *sg_ref = ref; + *sg = (struct blkif_request_segment) { + .gref = ref, + .first_sect = fsect, + .last_sect = lsect + }; + sg++; + sg_ref++; + segs++; + nsegs--; + } + block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK); + if (block_segs == 0) + break; -/************************ end VBD support *****************/ + sg = BLKRING_GET_SEG_BLOCK(&sc->xbd_ring, + sc->xbd_ring.req_prod_pvt); + sc->xbd_ring.req_prod_pvt++; + last_block_sg = sg + block_segs; + } -/* - * Read/write routine for a buffer. Finds the proper unit, place it on - * the sortq and kick the controller. - */ -static void -xbd_strategy(struct bio *bp) -{ - struct xbd_softc *sc = bp->bio_disk->d_drv1; + if (cm->cm_operation == BLKIF_OP_READ) + op = BUS_DMASYNC_PREREAD; + else if (cm->cm_operation == BLKIF_OP_WRITE) + op = BUS_DMASYNC_PREWRITE; + else + op = 0; + bus_dmamap_sync(sc->xbd_io_dmat, cm->cm_map, op); - /* bogus disk? */ - if (sc == NULL) { - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - biodone(bp); - return; - } + gnttab_free_grant_references(cm->cm_gref_head); + + xbd_enqueue_busy(cm); /* - * Place it in the queue of disk activities for this disk + * This flag means that we're probably executing in the busdma swi + * instead of in the startio context, so an explicit flush is needed. */ - mtx_lock(&sc->xbd_io_lock); - - xbd_enqueue_bio(sc, bp); - xbd_startio(sc); + if (cm->cm_flags & XBD_CMD_FROZEN) + flush_requests(sc); - mtx_unlock(&sc->xbd_io_lock); return; } -static void -xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) +static int +xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm) { - struct bio *bp; - - bp = cm->cm_bp; + int error; - if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { - disk_err(bp, "disk error" , -1, 0); - printf(" status: %x\n", cm->cm_status); - bp->bio_flags |= BIO_ERROR; + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); + if (error == EINPROGRESS) { + printf("EINPROGRESS\n"); + sc->xbd_flags |= XBD_FROZEN; + cm->cm_flags |= XBD_CMD_FROZEN; + return (0); } - if (bp->bio_flags & BIO_ERROR) - bp->bio_error = EIO; - else + return (error); +} + +static void +xbd_restart_queue_callback(void *arg) +{ + struct xbd_softc *sc = arg; + + mtx_lock(&sc->xbd_io_lock); + + xbd_startio(sc); + + mtx_unlock(&sc->xbd_io_lock); +} + +static struct xbd_command * +xbd_bio_command(struct xbd_softc *sc) +{ + struct xbd_command *cm; + struct bio *bp; + + if (unlikely(sc->xbd_connected != XBD_STATE_CONNECTED)) + return (NULL); + + bp = xbd_dequeue_bio(sc); + if (bp == NULL) + return (NULL); + + if ((cm = xbd_dequeue_free(sc)) == NULL) { + xbd_requeue_bio(sc, bp); + return (NULL); + } + + if (gnttab_alloc_grant_references(sc->xbd_max_request_segments, + &cm->cm_gref_head) != 0) { + gnttab_request_free_callback(&sc->xbd_callback, + xbd_restart_queue_callback, sc, + sc->xbd_max_request_segments); + xbd_requeue_bio(sc, bp); + xbd_enqueue_free(cm); + sc->xbd_flags |= XBD_FROZEN; + return (NULL); + } + + cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; + cm->cm_operation = (bp->bio_cmd == BIO_READ) ? + BLKIF_OP_READ : BLKIF_OP_WRITE; + cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; + + return (cm); +} + +/* + * Dequeue buffers and place them in the shared communication ring. + * Return when no more requests can be accepted or all buffers have + * been queued. + * + * Signal XEN once the ring has been filled out. + */ +static void +xbd_startio(struct xbd_softc *sc) +{ + struct xbd_command *cm; + int error, queued = 0; + + mtx_assert(&sc->xbd_io_lock, MA_OWNED); + + if (sc->xbd_connected != XBD_STATE_CONNECTED) + return; + + while (RING_FREE_REQUESTS(&sc->xbd_ring) >= + sc->xbd_max_request_blocks) { + if (sc->xbd_flags & XBD_FROZEN) + break; + + cm = xbd_dequeue_ready(sc); + + if (cm == NULL) + cm = xbd_bio_command(sc); + + if (cm == NULL) + break; + + if ((error = xbd_queue_request(sc, cm)) != 0) { + printf("xbd_queue_request returned %d\n", error); + break; + } + queued++; + } + + if (queued != 0) + flush_requests(sc); +} + +static void +xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm) +{ + struct bio *bp; + + bp = cm->cm_bp; + + if (unlikely(cm->cm_status != BLKIF_RSP_OKAY)) { + disk_err(bp, "disk error" , -1, 0); + printf(" status: %x\n", cm->cm_status); + bp->bio_flags |= BIO_ERROR; + } + + if (bp->bio_flags & BIO_ERROR) + bp->bio_error = EIO; + else bp->bio_resid = 0; xbd_free_command(cm); biodone(bp); } -// Quiesce the disk writes for a dump file before allowing the next buffer. +static int +xbd_completion(struct xbd_command *cm) +{ + gnttab_end_foreign_access_references(cm->cm_nseg, cm->cm_sg_refs); + return (BLKIF_SEGS_TO_BLOCKS(cm->cm_nseg)); +} + +static void +xbd_int(void *xsc) +{ + struct xbd_softc *sc = xsc; + struct xbd_command *cm; + blkif_response_t *bret; + RING_IDX i, rp; + int op; + + mtx_lock(&sc->xbd_io_lock); + + if (unlikely(sc->xbd_connected == XBD_STATE_DISCONNECTED)) { + mtx_unlock(&sc->xbd_io_lock); + return; + } + + again: + rp = sc->xbd_ring.sring->rsp_prod; + rmb(); /* Ensure we see queued responses up to 'rp'. */ + + for (i = sc->xbd_ring.rsp_cons; i != rp;) { + bret = RING_GET_RESPONSE(&sc->xbd_ring, i); + cm = &sc->xbd_shadow[bret->id]; + + xbd_remove_busy(cm); + i += xbd_completion(cm); + + if (cm->cm_operation == BLKIF_OP_READ) + op = BUS_DMASYNC_POSTREAD; + else if (cm->cm_operation == BLKIF_OP_WRITE) + op = BUS_DMASYNC_POSTWRITE; + else + op = 0; + bus_dmamap_sync(sc->xbd_io_dmat, cm->cm_map, op); + bus_dmamap_unload(sc->xbd_io_dmat, cm->cm_map); + + /* + * If commands are completing then resources are probably + * being freed as well. It's a cheap assumption even when + * wrong. + */ + sc->xbd_flags &= ~XBD_FROZEN; + + /* + * Directly call the i/o complete routine to save an + * an indirection in the common case. + */ + cm->cm_status = bret->status; + if (cm->cm_bp) + xbd_bio_complete(sc, cm); + else if (cm->cm_complete != NULL) + cm->cm_complete(cm); + else + xbd_free_command(cm); + } + + sc->xbd_ring.rsp_cons = i; + + if (i != sc->xbd_ring.req_prod_pvt) { + int more_to_do; + RING_FINAL_CHECK_FOR_RESPONSES(&sc->xbd_ring, more_to_do); + if (more_to_do) + goto again; + } else { + sc->xbd_ring.sring->rsp_event = i + 1; + } + + xbd_startio(sc); + + if (unlikely(sc->xbd_connected == XBD_STATE_SUSPENDED)) + wakeup(&sc->xbd_cm_busy); + + mtx_unlock(&sc->xbd_io_lock); +} + +/*------------------------------- Dump Support -------------------------------*/ +/** + * Quiesce the disk writes for a dump file before allowing the next buffer. + */ static void xbd_quiesce(struct xbd_softc *sc) { @@ -396,171 +560,375 @@ xbd_dump(void *arg, void *virtual, vm_of return (rc); } - +/*----------------------------- Disk Entrypoints -----------------------------*/ static int -xbd_probe(device_t dev) +xbd_open(struct disk *dp) { + struct xbd_softc *sc = dp->d_drv1; - if (!strcmp(xenbus_get_type(dev), "vbd")) { - device_set_desc(dev, "Virtual Block Device"); - device_quiet(dev); - return (0); + if (sc == NULL) { + printf("xb%d: not found", sc->xbd_unit); + return (ENXIO); } - return (ENXIO); + sc->xbd_flags |= XBD_OPEN; + sc->xbd_users++; + return (0); } -static void -xbd_setup_sysctl(struct xbd_softc *xbd) +static int +xbd_close(struct disk *dp) { - struct sysctl_ctx_list *sysctl_ctx = NULL; - struct sysctl_oid *sysctl_tree = NULL; - - sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); - if (sysctl_ctx == NULL) - return; + struct xbd_softc *sc = dp->d_drv1; - sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); - if (sysctl_tree == NULL) - return; + if (sc == NULL) + return (ENXIO); + sc->xbd_flags &= ~XBD_OPEN; + if (--(sc->xbd_users) == 0) { + /* + * Check whether we have been instructed to close. We will + * have ignored this request initially, as the device was + * still mounted. + */ + if (xenbus_get_otherend_state(sc->xbd_dev) == + XenbusStateClosing) + xbd_closing(sc->xbd_dev); + } + return (0); +} - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, - "maximum outstanding requests (negotiated)"); +static int +xbd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td) +{ + struct xbd_softc *sc = dp->d_drv1; - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_segments", CTLFLAG_RD, - &xbd->xbd_max_request_segments, 0, - "maximum number of pages per requests (negotiated)"); + if (sc == NULL) + return (ENXIO); - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, - "maximum size in bytes of a request (negotiated)"); - - SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, - "communication channel pages (negotiated)"); + return (ENOTTY); } /* - * Setup supplies the backend dir, virtual device. We place an event - * channel and shared frame entries. We watch backend to wait if it's - * ok. + * Read/write routine for a buffer. Finds the proper unit, place it on + * the sortq and kick the controller. */ -static int -xbd_attach(device_t dev) +static void +xbd_strategy(struct bio *bp) { - struct xbd_softc *sc; - const char *name; - uint32_t vdevice; - int error; - int i; - int unit; + struct xbd_softc *sc = bp->bio_disk->d_drv1; - /* FIXME: Use dynamic device id if this is not set. */ - error = xs_scanf(XST_NIL, xenbus_get_node(dev), - "virtual-device", NULL, "%" PRIu32, &vdevice); - if (error) { - xenbus_dev_fatal(dev, error, "reading virtual-device"); - device_printf(dev, "Couldn't determine virtual device.\n"); - return (error); + /* bogus disk? */ + if (sc == NULL) { + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + return; } - xbd_vdevice_to_unit(vdevice, &unit, &name); - if (!strcmp(name, "xbd")) - device_set_unit(dev, unit); - - sc = device_get_softc(dev); - mtx_init(&sc->xbd_io_lock, "blkfront i/o lock", NULL, MTX_DEF); - xbd_initq_free(sc); - xbd_initq_busy(sc); - xbd_initq_ready(sc); - xbd_initq_complete(sc); - xbd_initq_bio(sc); - for (i = 0; i < XBD_MAX_RING_PAGES; i++) - sc->xbd_ring_ref[i] = GRANT_INVALID_REF; - - sc->xbd_dev = dev; - sc->xbd_vdevice = vdevice; - sc->xbd_connected = XBD_STATE_DISCONNECTED; - - xbd_setup_sysctl(sc); + /* + * Place it in the queue of disk activities for this disk + */ + mtx_lock(&sc->xbd_io_lock); - /* Wait for backend device to publish its protocol capabilities. */ - xenbus_set_state(dev, XenbusStateInitialising); + xbd_enqueue_bio(sc, bp); + xbd_startio(sc); - return (0); + mtx_unlock(&sc->xbd_io_lock); + return; } -static int -xbd_suspend(device_t dev) +/*------------------------------ Ring Management -----------------------------*/ +static int +xbd_setup_ring(struct xbd_softc *sc) { - struct xbd_softc *sc = device_get_softc(dev); - int retval; - int saved_state; + blkif_sring_t *sring; + uintptr_t sring_page_addr; + int error; + int i; - /* Prevent new requests being issued until we fix things up. */ - mtx_lock(&sc->xbd_io_lock); - saved_state = sc->xbd_connected; - sc->xbd_connected = XBD_STATE_SUSPENDED; + sring = malloc(sc->xbd_ring_pages * PAGE_SIZE, M_XENBLOCKFRONT, + M_NOWAIT|M_ZERO); + if (sring == NULL) { + xenbus_dev_fatal(sc->xbd_dev, ENOMEM, "allocating shared ring"); + return (ENOMEM); + } + SHARED_RING_INIT(sring); + FRONT_RING_INIT(&sc->xbd_ring, sring, sc->xbd_ring_pages * PAGE_SIZE); - /* Wait for outstanding I/O to drain. */ - retval = 0; - while (TAILQ_EMPTY(&sc->xbd_cm_busy) == 0) { - if (msleep(&sc->xbd_cm_busy, &sc->xbd_io_lock, - PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { - retval = EBUSY; - break; + for (i = 0, sring_page_addr = (uintptr_t)sring; + i < sc->xbd_ring_pages; + i++, sring_page_addr += PAGE_SIZE) { + + error = xenbus_grant_ring(sc->xbd_dev, + (vtomach(sring_page_addr) >> PAGE_SHIFT), + &sc->xbd_ring_ref[i]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "granting ring_ref(%d)", i); + return (error); } } - mtx_unlock(&sc->xbd_io_lock); + if (sc->xbd_ring_pages == 1) { + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + "ring-ref", "%u", sc->xbd_ring_ref[0]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/ring-ref", + xenbus_get_node(sc->xbd_dev)); + return (error); + } + } else { + for (i = 0; i < sc->xbd_ring_pages; i++) { + char ring_ref_name[]= "ring_refXX"; - if (retval != 0) - sc->xbd_connected = saved_state; + snprintf(ring_ref_name, sizeof(ring_ref_name), + "ring-ref%u", i); + error = xs_printf(XST_NIL, xenbus_get_node(sc->xbd_dev), + ring_ref_name, "%u", sc->xbd_ring_ref[i]); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "writing %s/%s", + xenbus_get_node(sc->xbd_dev), + ring_ref_name); + return (error); + } + } + } - return (retval); + error = bind_listening_port_to_irqhandler( + xenbus_get_otherend_id(sc->xbd_dev), + "xbd", (driver_intr_t *)xbd_int, sc, + INTR_TYPE_BIO | INTR_MPSAFE, &sc->xbd_irq); + if (error) { + xenbus_dev_fatal(sc->xbd_dev, error, + "bind_evtchn_to_irqhandler failed"); + return (error); + } + + return (0); } -static int -xbd_resume(device_t dev) +/*-------------------------- Initialization/Teardown -------------------------*/ +static void +xbd_setup_sysctl(struct xbd_softc *xbd) { - struct xbd_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *sysctl_ctx = NULL; + struct sysctl_oid *sysctl_tree = NULL; + + sysctl_ctx = device_get_sysctl_ctx(xbd->xbd_dev); + if (sysctl_ctx == NULL) + return; - DPRINTK("xbd_resume: %s\n", xenbus_get_node(dev)); + sysctl_tree = device_get_sysctl_tree(xbd->xbd_dev); + if (sysctl_tree == NULL) + return; - xbd_free(sc); - xbd_initialize(sc); - return (0); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_requests", CTLFLAG_RD, &xbd->xbd_max_requests, -1, + "maximum outstanding requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_segments", CTLFLAG_RD, + &xbd->xbd_max_request_segments, 0, + "maximum number of pages per requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, + "communication channel pages (negotiated)"); } +/* + * Translate Linux major/minor to an appropriate name and unit + * number. For HVM guests, this allows us to use the same drive names + * with blkfront as the emulated drives, easing transition slightly. + */ static void -xbd_initialize(struct xbd_softc *sc) +xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) { - const char *otherend_path; - const char *node_path; - uint32_t max_ring_page_order; - int error; + static struct vdev_info { + int major; + int shift; + int base; + const char *name; + } info[] = { + {3, 6, 0, "ada"}, /* ide0 */ + {22, 6, 2, "ada"}, /* ide1 */ + {33, 6, 4, "ada"}, /* ide2 */ + {34, 6, 6, "ada"}, /* ide3 */ + {56, 6, 8, "ada"}, /* ide4 */ + {57, 6, 10, "ada"}, /* ide5 */ + {88, 6, 12, "ada"}, /* ide6 */ + {89, 6, 14, "ada"}, /* ide7 */ + {90, 6, 16, "ada"}, /* ide8 */ + {91, 6, 18, "ada"}, /* ide9 */ + + {8, 4, 0, "da"}, /* scsi disk0 */ + {65, 4, 16, "da"}, /* scsi disk1 */ + {66, 4, 32, "da"}, /* scsi disk2 */ + {67, 4, 48, "da"}, /* scsi disk3 */ + {68, 4, 64, "da"}, /* scsi disk4 */ + {69, 4, 80, "da"}, /* scsi disk5 */ + {70, 4, 96, "da"}, /* scsi disk6 */ + {71, 4, 112, "da"}, /* scsi disk7 */ + {128, 4, 128, "da"}, /* scsi disk8 */ + {129, 4, 144, "da"}, /* scsi disk9 */ + {130, 4, 160, "da"}, /* scsi disk10 */ + {131, 4, 176, "da"}, /* scsi disk11 */ + {132, 4, 192, "da"}, /* scsi disk12 */ + {133, 4, 208, "da"}, /* scsi disk13 */ + {134, 4, 224, "da"}, /* scsi disk14 */ + {135, 4, 240, "da"}, /* scsi disk15 */ + + {202, 4, 0, "xbd"}, /* xbd */ + + {0, 0, 0, NULL}, + }; + int major = vdevice >> 8; + int minor = vdevice & 0xff; int i; - if (xenbus_get_state(sc->xbd_dev) != XenbusStateInitialising) { - /* Initialization has already been performed. */ + if (vdevice & (1 << 28)) { + *unit = (vdevice & ((1 << 28) - 1)) >> 8; + *name = "xbd"; return; } - /* - * Protocol defaults valid even if negotiation for a - * setting fails. - */ - max_ring_page_order = 0; - sc->xbd_ring_pages = 1; - sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->xbd_max_request_size = - XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); - sc->xbd_max_request_blocks = - BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments); + for (i = 0; info[i].major; i++) { + if (info[i].major == major) { + *unit = info[i].base + (minor >> info[i].shift); + *name = info[i].name; + return; + } + } - /* - * Protocol negotiation. + *unit = minor >> 4; + *name = "xbd"; +} + +int +xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, + int vdevice, uint16_t vdisk_info, unsigned long sector_size) +{ + int unit, error = 0; + const char *name; + + xbd_vdevice_to_unit(vdevice, &unit, &name); + + sc->xbd_unit = unit; + + if (strcmp(name, "xbd")) + device_printf(sc->xbd_dev, "attaching as %s%d\n", name, unit); + + sc->xbd_disk = disk_alloc(); + sc->xbd_disk->d_unit = sc->xbd_unit; + sc->xbd_disk->d_open = xbd_open; + sc->xbd_disk->d_close = xbd_close; + sc->xbd_disk->d_ioctl = xbd_ioctl; + sc->xbd_disk->d_strategy = xbd_strategy; + sc->xbd_disk->d_dump = xbd_dump; + sc->xbd_disk->d_name = name; + sc->xbd_disk->d_drv1 = sc; + sc->xbd_disk->d_sectorsize = sector_size; + + sc->xbd_disk->d_mediasize = sectors * sector_size; + sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; + sc->xbd_disk->d_flags = 0; + disk_create(sc->xbd_disk, DISK_VERSION); + + return error; +} + +static void +xbd_free(struct xbd_softc *sc) +{ + uint8_t *sring_page_ptr; + int i; + + /* Prevent new requests being issued until we fix things up. */ + mtx_lock(&sc->xbd_io_lock); + sc->xbd_connected = XBD_STATE_DISCONNECTED; + mtx_unlock(&sc->xbd_io_lock); + + /* Free resources associated with old device channel. */ + if (sc->xbd_ring.sring != NULL) { + sring_page_ptr = (uint8_t *)sc->xbd_ring.sring; + for (i = 0; i < sc->xbd_ring_pages; i++) { + grant_ref_t *ref; + + ref = &sc->xbd_ring_ref[i]; + if (*ref != GRANT_INVALID_REF) { + gnttab_end_foreign_access_ref(*ref); + *ref = GRANT_INVALID_REF; + } + sring_page_ptr += PAGE_SIZE; + } + free(sc->xbd_ring.sring, M_XENBLOCKFRONT); + sc->xbd_ring.sring = NULL; + } + + if (sc->xbd_shadow) { + + for (i = 0; i < sc->xbd_max_requests; i++) { + struct xbd_command *cm; + + cm = &sc->xbd_shadow[i]; + if (cm->cm_sg_refs != NULL) { + free(cm->cm_sg_refs, M_XENBLOCKFRONT); + cm->cm_sg_refs = NULL; + } + + bus_dmamap_destroy(sc->xbd_io_dmat, cm->cm_map); + } + free(sc->xbd_shadow, M_XENBLOCKFRONT); + sc->xbd_shadow = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:33:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18BBB384; Fri, 31 May 2013 22:33:29 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A05FF9C; Fri, 31 May 2013 22:33:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMXSTC095823; Fri, 31 May 2013 22:33:28 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMXStp095822; Fri, 31 May 2013 22:33:28 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305312233.r4VMXStp095822@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 31 May 2013 22:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251206 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:33:29 -0000 Author: gibbs Date: Fri May 31 22:33:28 2013 New Revision: 251206 URL: http://svnweb.freebsd.org/changeset/base/251206 Log: Style changes. No intended functional changes. o rename flush_requests => xbd_flush_requests o rename xbd_setup_ring => xbd_alloc_ring Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:23:17 2013 (r251205) +++ head/sys/dev/xen/blkfront/blkfront.c Fri May 31 22:33:28 2013 (r251206) @@ -105,7 +105,7 @@ static MALLOC_DEFINE(M_XENBLOCKFRONT, "x /*---------------------------- Command Processing ----------------------------*/ static inline void -flush_requests(struct xbd_softc *sc) +xbd_flush_requests(struct xbd_softc *sc) { int notify; @@ -232,7 +232,7 @@ xbd_queue_cb(void *arg, bus_dma_segment_ * instead of in the startio context, so an explicit flush is needed. */ if (cm->cm_flags & XBD_CMD_FROZEN) - flush_requests(sc); + xbd_flush_requests(sc); return; } @@ -344,7 +344,7 @@ xbd_startio(struct xbd_softc *sc) } if (queued != 0) - flush_requests(sc); + xbd_flush_requests(sc); } static void @@ -640,7 +640,7 @@ xbd_strategy(struct bio *bp) /*------------------------------ Ring Management -----------------------------*/ static int -xbd_setup_ring(struct xbd_softc *sc) +xbd_alloc_ring(struct xbd_softc *sc) { blkif_sring_t *sring; uintptr_t sring_page_addr; @@ -1071,7 +1071,7 @@ xbd_initialize(struct xbd_softc *sc) xbd_free_command(cm); } - if (xbd_setup_ring(sc) != 0) + if (xbd_alloc_ring(sc) != 0) return; /* Support both backend schemes for relaying ring page limits. */ From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:54:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 74C918E4; Fri, 31 May 2013 22:54:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 566D67A; Fri, 31 May 2013 22:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMsLsr002968; Fri, 31 May 2013 22:54:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMsKnB002964; Fri, 31 May 2013 22:54:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312254.r4VMsKnB002964@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251208 - in head: bin/test tools/regression/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:54:21 -0000 Author: jilles Date: Fri May 31 22:54:20 2013 New Revision: 251208 URL: http://svnweb.freebsd.org/changeset/base/251208 Log: test: Remove -ntXY and -otXY primaries. This reverts commit r247274. As maintainer of sh, I disapprove of this feature addition. It is too specific and can be done without easily using find(1) or stat(1). I will add some hints to the test(1) man page shortly. In general, FreeBSD sh is not the place to invent new shell language features. This is how it has been maintained and adding features randomly does not work with that. The new syntax (e.g. [ FILE1 -ntca FILE2 ]) looks cryptic to me. Modified: head/bin/test/test.1 head/bin/test/test.c head/tools/regression/bin/test/regress.sh Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:53:44 2013 (r251207) +++ head/bin/test/test.1 Fri May 31 22:54:20 2013 (r251208) @@ -169,65 +169,15 @@ True if .Ar file exists and is a socket. .It Ar file1 Fl nt Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and -.Ar file1 -is newer than -.Ar file2 . -.It Ar file1 Fl nt Ns Ar X Ns Ar Y Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and +True if .Ar file1 -has a more recent last access time -.Pq Ar X Ns = Ns Cm a , -inode creation time -.Pq Ar X Ns = Ns Cm b , -change time -.Pq Ar X Ns = Ns Cm c , -or modification time -.Pq Ar X Ns = Ns Cm m -than the last access time -.Pq Ar Y Ns = Ns Cm a , -inode creation time -.Pq Ar Y Ns = Ns Cm b , -change time -.Pq Ar Y Ns = Ns Cm c , -or modification time -.Pq Ar Y Ns = Ns Cm m -of +exists and is newer than .Ar file2 . -Note that -.Ic -ntmm -is equivalent to -.Ic -nt . .It Ar file1 Fl ot Ar file2 -True if both -.Ar file1 -and -.Ar file2 -exist and +True if .Ar file1 -is older than +exists and is older than .Ar file2 . -Note that -.Ar file1 -.Ic -ot -.Ar file2 -is equivalent to -.Ar file2 -.Ic -nt -.Ar file1 -.It Ar file1 Fl ot Ns Ar X Ns Ar Y Ar file2 -Equivalent to -.Ar file2 -.Ic -nt Ns Ar Y Ns Ar X -.Ar file1 . .It Ar file1 Fl ef Ar file2 True if .Ar file1 Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Fri May 31 22:53:44 2013 (r251207) +++ head/bin/test/test.c Fri May 31 22:54:20 2013 (r251208) @@ -63,7 +63,7 @@ error(const char *msg, ...) "-u"|"-g"|"-k"|"-s"|"-t"|"-z"|"-n"|"-o"|"-O"|"-G"|"-L"|"-S"; binary-operator ::= "="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-le"|"-lt"| - "-nt"|"-nt[abcm][abcm]"|"-ot"|"-ot[abcm][abcm])"|"-ef"; + "-nt"|"-ot"|"-ef"; operand ::= */ @@ -85,38 +85,8 @@ enum token { FILSUID, FILSGID, FILSTCK, - FILNTAA, - FILNTAB, - FILNTAC, - FILNTAM, - FILNTBA, - FILNTBB, - FILNTBC, - FILNTBM, - FILNTCA, - FILNTCB, - FILNTCC, - FILNTCM, - FILNTMA, - FILNTMB, - FILNTMC, - FILNTMM, - FILOTAA, - FILOTAB, - FILOTAC, - FILOTAM, - FILOTBA, - FILOTBB, - FILOTBC, - FILOTBM, - FILOTCA, - FILOTCB, - FILOTCC, - FILOTCM, - FILOTMA, - FILOTMB, - FILOTMC, - FILOTMM, + FILNT, + FILOT, FILEQ, FILUID, FILGID, @@ -148,16 +118,9 @@ enum token_types { PAREN }; -enum time_types { - ATIME, - BTIME, - CTIME, - MTIME -}; - static struct t_op { - char op_text[6]; - char op_num, op_type; + char op_text[4]; + short op_num, op_type; } const ops [] = { {"-r", FILRD, UNOP}, {"-w", FILWR, UNOP}, @@ -191,40 +154,8 @@ static struct t_op { {"-gt", INTGT, BINOP}, {"-le", INTLE, BINOP}, {"-lt", INTLT, BINOP}, - {"-nt", FILNTMM, BINOP}, - {"-ntaa", FILNTAA, BINOP}, - {"-ntab", FILNTAB, BINOP}, - {"-ntac", FILNTAC, BINOP}, - {"-ntam", FILNTAM, BINOP}, - {"-ntba", FILNTBA, BINOP}, - {"-ntbb", FILNTBB, BINOP}, - {"-ntbc", FILNTBC, BINOP}, - {"-ntbm", FILNTBM, BINOP}, - {"-ntca", FILNTCA, BINOP}, - {"-ntcb", FILNTCB, BINOP}, - {"-ntcc", FILNTCC, BINOP}, - {"-ntcm", FILNTCM, BINOP}, - {"-ntma", FILNTMA, BINOP}, - {"-ntmb", FILNTMB, BINOP}, - {"-ntmc", FILNTMC, BINOP}, - {"-ntmm", FILNTMM, BINOP}, - {"-ot", FILOTMM, BINOP}, - {"-otaa", FILOTAA, BINOP}, - {"-otab", FILOTBB, BINOP}, - {"-otac", FILOTAC, BINOP}, - {"-otam", FILOTAM, BINOP}, - {"-otba", FILOTBA, BINOP}, - {"-otbb", FILOTBB, BINOP}, - {"-otbc", FILOTBC, BINOP}, - {"-otbm", FILOTBM, BINOP}, - {"-otca", FILOTCA, BINOP}, - {"-otcb", FILOTCB, BINOP}, - {"-otcc", FILOTCC, BINOP}, - {"-otcm", FILOTCM, BINOP}, - {"-otma", FILOTMA, BINOP}, - {"-otmb", FILOTMB, BINOP}, - {"-otmc", FILOTMC, BINOP}, - {"-otmm", FILOTMM, BINOP}, + {"-nt", FILNT, BINOP}, + {"-ot", FILOT, BINOP}, {"-ef", FILEQ, BINOP}, {"!", UNOT, BUNOP}, {"-a", BAND, BBINOP}, @@ -249,10 +180,10 @@ static int intcmp(const char *, const ch static int isunopoperand(void); static int islparenoperand(void); static int isrparenoperand(void); -static int newerf(const char *, const char *, enum time_types, - enum time_types); +static int newerf(const char *, const char *); static int nexpr(enum token); static int oexpr(enum token); +static int olderf(const char *, const char *); static int primary(enum token); static void syntax(const char *, const char *); static enum token t_lex(char *); @@ -422,70 +353,10 @@ binop(void) return intcmp(opnd1, opnd2) <= 0; case INTLT: return intcmp(opnd1, opnd2) < 0; - case FILNTAA: - return newerf(opnd1, opnd2, ATIME, ATIME); - case FILNTAB: - return newerf(opnd1, opnd2, ATIME, BTIME); - case FILNTAC: - return newerf(opnd1, opnd2, ATIME, CTIME); - case FILNTAM: - return newerf(opnd1, opnd2, ATIME, MTIME); - case FILNTBA: - return newerf(opnd1, opnd2, BTIME, ATIME); - case FILNTBB: - return newerf(opnd1, opnd2, BTIME, BTIME); - case FILNTBC: - return newerf(opnd1, opnd2, BTIME, CTIME); - case FILNTBM: - return newerf(opnd1, opnd2, BTIME, MTIME); - case FILNTCA: - return newerf(opnd1, opnd2, CTIME, ATIME); - case FILNTCB: - return newerf(opnd1, opnd2, CTIME, BTIME); - case FILNTCC: - return newerf(opnd1, opnd2, CTIME, CTIME); - case FILNTCM: - return newerf(opnd1, opnd2, CTIME, MTIME); - case FILNTMA: - return newerf(opnd1, opnd2, MTIME, ATIME); - case FILNTMB: - return newerf(opnd1, opnd2, MTIME, BTIME); - case FILNTMC: - return newerf(opnd1, opnd2, MTIME, CTIME); - case FILNTMM: - return newerf(opnd1, opnd2, MTIME, MTIME); - case FILOTAA: - return newerf(opnd2, opnd1, ATIME, ATIME); - case FILOTAB: - return newerf(opnd2, opnd1, BTIME, ATIME); - case FILOTAC: - return newerf(opnd2, opnd1, CTIME, ATIME); - case FILOTAM: - return newerf(opnd2, opnd1, MTIME, ATIME); - case FILOTBA: - return newerf(opnd2, opnd1, ATIME, BTIME); - case FILOTBB: - return newerf(opnd2, opnd1, BTIME, BTIME); - case FILOTBC: - return newerf(opnd2, opnd1, CTIME, BTIME); - case FILOTBM: - return newerf(opnd2, opnd1, MTIME, BTIME); - case FILOTCA: - return newerf(opnd2, opnd1, ATIME, CTIME); - case FILOTCB: - return newerf(opnd2, opnd1, BTIME, CTIME); - case FILOTCC: - return newerf(opnd2, opnd1, CTIME, CTIME); - case FILOTCM: - return newerf(opnd2, opnd1, MTIME, CTIME); - case FILOTMA: - return newerf(opnd2, opnd1, ATIME, MTIME); - case FILOTMB: - return newerf(opnd2, opnd1, BTIME, MTIME); - case FILOTMC: - return newerf(opnd2, opnd1, CTIME, MTIME); - case FILOTMM: - return newerf(opnd2, opnd1, MTIME, MTIME); + case FILNT: + return newerf (opnd1, opnd2); + case FILOT: + return olderf (opnd1, opnd2); case FILEQ: return equalf (opnd1, opnd2); default: @@ -699,34 +570,25 @@ intcmp (const char *s1, const char *s2) } static int -newerf (const char *f1, const char *f2, enum time_types t1, enum time_types t2) +newerf (const char *f1, const char *f2) { struct stat b1, b2; - struct timespec *ts1, *ts2; if (stat(f1, &b1) != 0 || stat(f2, &b2) != 0) return 0; - switch (t1) { - case ATIME: ts1 = &b1.st_atim; break; - case BTIME: ts1 = &b1.st_birthtim; break; - case CTIME: ts1 = &b1.st_ctim; break; - default: ts1 = &b1.st_mtim; break; - } - - switch (t2) { - case ATIME: ts2 = &b2.st_atim; break; - case BTIME: ts2 = &b2.st_birthtim; break; - case CTIME: ts2 = &b2.st_ctim; break; - default: ts2 = &b2.st_mtim; break; - } - - if (ts1->tv_sec > ts2->tv_sec) + if (b1.st_mtim.tv_sec > b2.st_mtim.tv_sec) return 1; - if (ts1->tv_sec < ts2->tv_sec) + if (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec) return 0; - return (ts1->tv_nsec > ts2->tv_nsec); + return (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec); +} + +static int +olderf (const char *f1, const char *f2) +{ + return (newerf(f2, f1)); } static int Modified: head/tools/regression/bin/test/regress.sh ============================================================================== --- head/tools/regression/bin/test/regress.sh Fri May 31 22:53:44 2013 (r251207) +++ head/tools/regression/bin/test/regress.sh Fri May 31 22:54:20 2013 (r251208) @@ -52,7 +52,7 @@ t () } count=0 -echo "1..266" +echo "1..130" t 0 'b = b' t 0 'b == b' @@ -194,66 +194,3 @@ t 1 '\( ! -a \)' t 0 '\( -n -o \)' t 1 '\( -z -o \)' t 1 '\( ! -o \)' - -# Test all file timestamp comparison operators -s() { - t ${1} "${35} -nt ${36}" - t ${2} "${35} -ntaa ${36}" - t ${3} "${35} -ntab ${36}" - t ${4} "${35} -ntac ${36}" - t ${5} "${35} -ntam ${36}" - t ${6} "${35} -ntba ${36}" - t ${7} "${35} -ntbb ${36}" - t ${8} "${35} -ntbc ${36}" - t ${9} "${35} -ntbm ${36}" - t ${10} "${35} -ntca ${36}" - t ${11} "${35} -ntcb ${36}" - t ${12} "${35} -ntcc ${36}" - t ${13} "${35} -ntcm ${36}" - t ${14} "${35} -ntma ${36}" - t ${15} "${35} -ntmb ${36}" - t ${16} "${35} -ntmc ${36}" - t ${17} "${35} -ntmm ${36}" - t ${18} "${35} -ot ${36}" - t ${19} "${35} -otaa ${36}" - t ${20} "${35} -otab ${36}" - t ${21} "${35} -otac ${36}" - t ${22} "${35} -otam ${36}" - t ${23} "${35} -otba ${36}" - t ${24} "${35} -otbb ${36}" - t ${25} "${35} -otbc ${36}" - t ${26} "${35} -otbm ${36}" - t ${27} "${35} -otca ${36}" - t ${28} "${35} -otcb ${36}" - t ${29} "${35} -otcc ${36}" - t ${30} "${35} -otcm ${36}" - t ${31} "${35} -otma ${36}" - t ${32} "${35} -otmb ${36}" - t ${33} "${35} -otmc ${36}" - t ${34} "${35} -otmm ${36}" -} - -a=/tmp/test$$.1 -b=/tmp/test$$.2 -trap "rm -f $a $b" EXIT - -# Tests 131-164 -s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b - -touch $a -# Tests 165-198 -s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b - -sleep 2 # Ensure $b is newer than $a -touch $b -# Tests 199-232 -s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $a $b - -sleep 2 -echo >$b # Updates mtime & ctime -sleep 2 -touch -A 01 -a $b - -# $b now has ctime > mtime > atime > btime -# Tests 233-266 -s 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1 $b $b From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:55:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EBADABB; Fri, 31 May 2013 22:55:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9101988; Fri, 31 May 2013 22:55:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMtLiT003290; Fri, 31 May 2013 22:55:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMtLOC003289; Fri, 31 May 2013 22:55:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312255.r4VMtLOC003289@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251209 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:55:21 -0000 Author: jilles Date: Fri May 31 22:55:21 2013 New Revision: 251209 URL: http://svnweb.freebsd.org/changeset/base/251209 Log: test(1): List non-standard primaries. Modified: head/bin/test/test.1 Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:54:20 2013 (r251208) +++ head/bin/test/test.1 Fri May 31 22:55:21 2013 (r251209) @@ -32,7 +32,7 @@ .\" @(#)test.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd December 27, 2012 +.Dd June 1, 2013 .Dt TEST 1 .Os .Sh NAME @@ -349,6 +349,17 @@ The utility implements a superset of the .St -p1003.2 specification. +The primaries +.Cm < , +.Cm == , +.Cm > , +.Fl ef , +.Fl nt , +.Fl ot , +.Fl G , +and +.Fl O +are extensions. .Sh BUGS Both sides are always evaluated in .Fl a From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:55:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7CF03ABF; Fri, 31 May 2013 22:55:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5378B; Fri, 31 May 2013 22:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMtOth003336; Fri, 31 May 2013 22:55:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMtOBO003335; Fri, 31 May 2013 22:55:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305312255.r4VMtOBO003335@svn.freebsd.org> From: Xin LI Date: Fri, 31 May 2013 22:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251210 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:55:24 -0000 Author: delphij Date: Fri May 31 22:55:23 2013 New Revision: 251210 URL: http://svnweb.freebsd.org/changeset/base/251210 Log: MFV: Redo the fixup using the submitted version accepted by upstream. Modified: head/contrib/tcpdump/print-rip.c Directory Properties: head/contrib/tcpdump/ (props changed) Modified: head/contrib/tcpdump/print-rip.c ============================================================================== --- head/contrib/tcpdump/print-rip.c Fri May 31 22:55:21 2013 (r251209) +++ head/contrib/tcpdump/print-rip.c Fri May 31 22:55:23 2013 (r251210) @@ -17,8 +17,6 @@ * 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. - * - * $FreeBSD$ */ #ifndef lint @@ -143,7 +141,7 @@ rip_entry_print_v2(register const struct putchar (isprint(*p) ? *p : '.'); } else if (auth_type == 3) { printf("\n\t Auth header:"); - printf(" Packet Len %u,", EXTRACT_16BITS((u_int16_t *)ni + 2)); + printf(" Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4)); printf(" Key-ID %u,", *((u_int8_t *)ni + 6)); printf(" Auth Data Len %u,", *((u_int8_t *)ni + 7)); printf(" SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask)); From owner-svn-src-head@FreeBSD.ORG Fri May 31 22:57:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3739DAC; Fri, 31 May 2013 22:57:04 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E593F98; Fri, 31 May 2013 22:57:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VMv4XO003660; Fri, 31 May 2013 22:57:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VMv40W003659; Fri, 31 May 2013 22:57:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312257.r4VMv40W003659@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 22:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251211 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 22:57:05 -0000 Author: jilles Date: Fri May 31 22:57:04 2013 New Revision: 251211 URL: http://svnweb.freebsd.org/changeset/base/251211 Log: test(1): Add information about replacing -nt/-ot. Modified: head/bin/test/test.1 Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Fri May 31 22:55:23 2013 (r251210) +++ head/bin/test/test.1 Fri May 31 22:57:04 2013 (r251211) @@ -331,6 +331,20 @@ missing. .It >1 An error occurred. .El +.Sh EXAMPLES +Implement +.Li test FILE1 -nt FILE2 +using only +.Tn POSIX +functionality: +.Pp +.Dl test -n \&"$(find -L -- FILE1 -prune -newer FILE2 2>/dev/null)\&" +.Pp +This can be modified using non-standard +.Xr find 1 +primaries like +.Cm -newerca +to compare other timestamps. .Sh COMPATIBILITY For compatibility with some other implementations, the @@ -341,7 +355,9 @@ with the same meaning. .Sh SEE ALSO .Xr builtin 1 , .Xr expr 1 , +.Xr find 1 , .Xr sh 1 , +.Xr stat 1 , .Xr symlink 7 .Sh STANDARDS The From owner-svn-src-head@FreeBSD.ORG Fri May 31 23:31:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F370844C; Fri, 31 May 2013 23:31:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BDA0C18A; Fri, 31 May 2013 23:31:17 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id ECD29368; Sat, 1 Jun 2013 01:26:55 +0200 (CEST) Date: Sat, 1 Jun 2013 01:31:10 +0200 From: Pawel Jakub Dawidek To: Jilles Tjoelker Subject: Re: svn commit: r251197 - head/lib/libc/sys Message-ID: <20130531233109.GD1387@garage.freebsd.pl> References: <201305312131.r4VLVcd5074132@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="veXX9dWIonWZEC6h" Content-Disposition: inline In-Reply-To: <201305312131.r4VLVcd5074132@svn.freebsd.org> X-OS: 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 31 May 2013 23:31:18 -0000 --veXX9dWIonWZEC6h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2013 at 09:31:38PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Fri May 31 21:31:38 2013 > New Revision: 251197 > URL: http://svnweb.freebsd.org/changeset/base/251197 >=20 > Log: > sigaction(2): *at system calls are async-signal safe. Isn't chflags(2) family safe as well? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --veXX9dWIonWZEC6h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlGpMr0ACgkQForvXbEpPzQFCgCeORfa4EJVKktWLtWmJ9ZwhF+I m8YAoIW/ToJJpgiOFLziA8Yxx6pWplqs =CxX7 -----END PGP SIGNATURE----- --veXX9dWIonWZEC6h-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 01:02:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99DA2E81; Sat, 1 Jun 2013 01:02:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A96A603; Sat, 1 Jun 2013 01:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5112P7t047902; Sat, 1 Jun 2013 01:02:25 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5112O9A047896; Sat, 1 Jun 2013 01:02:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306010102.r5112O9A047896@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 01:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251212 - in head/contrib/gcc: . config/i386 doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 01:02:25 -0000 Author: pfg Date: Sat Jun 1 01:02:24 2013 New Revision: 251212 URL: http://svnweb.freebsd.org/changeset/base/251212 Log: GCC: bring back experimental support for amdfam10/barcelona CPUs. Initial support for the AMD amdfam10 chipsets has been available in the gcc43 branch under GPLv2. AMD and some linux distributions (OpenSUSE) did a backport of the amdfam10 support and made it available. This is a revised subset of the support initially brought in in r236962 and later reverted. The collateral efects seem to have disappeared but it is still recommended to set the CPUTYPE with caution. Reviewed by: jkim (ages ago) MFC after: 3 weeks Added: head/contrib/gcc/config/i386/ammintrin.h (contents, props changed) Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config.gcc head/contrib/gcc/config/i386/athlon.md head/contrib/gcc/config/i386/driver-i386.c head/contrib/gcc/config/i386/emmintrin.h head/contrib/gcc/config/i386/i386.c head/contrib/gcc/config/i386/i386.h head/contrib/gcc/config/i386/i386.md head/contrib/gcc/config/i386/i386.opt head/contrib/gcc/config/i386/pmmintrin.h head/contrib/gcc/config/i386/sse.md head/contrib/gcc/config/i386/tmmintrin.h head/contrib/gcc/doc/extend.texi head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/ChangeLog.gcc43 Sat Jun 1 01:02:24 2013 (r251212) @@ -1,3 +1,8 @@ +2007-05-01 Dwarakanath Rajagopal (r124341) + + * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of + 'AMD Family 10 core'. + 2007-05-01 Dwarakanath Rajagopal (r124339) * config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3 @@ -5,6 +10,12 @@ with SSE3 instruction set support. * doc/invoke.texi: Likewise. +2007-05-01 Dwarakanath Rajagopal (r124330) + + * config/i386/i386.c (override_options): Tuning 32-byte loop + alignment for amdfam10 architecture. Increasing the max loop + alignment to 24 bytes. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -21,6 +32,17 @@ * config/i386/i386.c (ix86_handle_option): Handle SSSE3. +2007-03-28 Dwarakanath Rajagopal (r123313) + + * config.gcc: Accept barcelona as a variant of amdfam10. + * config/i386/i386.c (override_options): Likewise. + * doc/invoke.texi: Likewise. + +2007-02-09 Dwarakanath Rajagopal (r121763) + + * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. + (bit_SSE4a): New. + 2007-02-08 Harsha Jagasia (r121726) * config/i386/xmmintrin.h: Make inclusion of emmintrin.h @@ -38,6 +60,168 @@ * config/i386/i386.c (override_options): Set PTA_SSSE3 for core2. +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_fldxf_k8, athlon_fld_k8, + athlon_fstxf_k8, athlon_fst_k8, athlon_fist, athlon_fmov, + athlon_fadd_load, athlon_fadd_load_k8, athlon_fadd, athlon_fmul, + athlon_fmul_load, athlon_fmul_load_k8, athlon_fsgn, + athlon_fdiv_load, athlon_fdiv_load_k8, athlon_fdiv_k8, + athlon_fpspc_load, athlon_fpspc, athlon_fcmov_load, + athlon_fcmov_load_k8, athlon_fcmov_k8, athlon_fcomi_load_k8, + athlon_fcomi, athlon_fcom_load_k8, athlon_fcom): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.md (x86_sahf_1, cmpfp_i_mixed, cmpfp_i_sse, + cmpfp_i_i387, cmpfp_iu_mixed, cmpfp_iu_sse, cmpfp_iu_387, + swapsi, swaphi_1, swapqi_1, swapdi_rex64, fix_truncsfdi_sse, + fix_truncdfdi_sse, fix_truncsfsi_sse, fix_truncdfsi_sse, + x86_fldcw_1, floatsisf2_mixed, floatsisf2_sse, floatdisf2_mixed, + floatdisf2_sse, floatsidf2_mixed, floatsidf2_sse, + floatdidf2_mixed, floatdidf2_sse, muldi3_1_rex64, mulsi3_1, + mulsi3_1_zext, mulhi3_1, mulqi3_1, umulqihi3_1, mulqihi3_insn, + umulditi3_insn, umulsidi3_insn, mulditi3_insn, mulsidi3_insn, + umuldi3_highpart_rex64, umulsi3_highpart_insn, + umulsi3_highpart_zext, smuldi3_highpart_rex64, + smulsi3_highpart_insn, smulsi3_highpart_zext, x86_64_shld, + x86_shld_1, x86_64_shrd, sqrtsf2_mixed, sqrtsf2_sse, + sqrtsf2_i387, sqrtdf2_mixed, sqrtdf2_sse, sqrtdf2_i387, + sqrtextendsfdf2_i387, sqrtxf2, sqrtextendsfxf2_i387, + sqrtextenddfxf2_i387): Added amdfam10_decode. + + * config/i386/athlon.md (athlon_idirect_amdfam10, + athlon_ivector_amdfam10, athlon_idirect_load_amdfam10, + athlon_ivector_load_amdfam10, athlon_idirect_both_amdfam10, + athlon_ivector_both_amdfam10, athlon_idirect_store_amdfam10, + athlon_ivector_store_amdfam10): New define_insn_reservation. + (athlon_idirect_loadmov, athlon_idirect_movstore): Added + amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_call_amdfam10, + athlon_pop_amdfam10, athlon_lea_amdfam10): New + define_insn_reservation. + (athlon_branch, athlon_push, athlon_leave_k8, athlon_imul_k8, + athlon_imul_k8_DI, athlon_imul_mem_k8, athlon_imul_mem_k8_DI, + athlon_idiv, athlon_idiv_mem, athlon_str): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseld_amdfam10, + athlon_mmxld_amdfam10, athlon_ssest_amdfam10, + athlon_mmxssest_short_amdfam10): New define_insn_reservation. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseins_amdfam10): New + define_insn_reservation. + * config/i386/i386.md (sseins): Added sseins to define_attr type + and define_attr unit. + * config/i386/sse.md: Set type attribute to sseins for insertq + and insertqi. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (sselog_load_amdfam10, sselog_amdfam10, + ssecmpvector_load_amdfam10, ssecmpvector_amdfam10, + ssecomi_load_amdfam10, ssecomi_amdfam10, + sseaddvector_load_amdfam10, sseaddvector_amdfam10): New + define_insn_reservation. + (ssecmp_load_k8, ssecmp, sseadd_load_k8, seadd): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (cvtss2sd_load_amdfam10, + cvtss2sd_amdfam10, cvtps2pd_load_amdfam10, cvtps2pd_amdfam10, + cvtsi2sd_load_amdfam10, cvtsi2ss_load_amdfam10, + cvtsi2sd_amdfam10, cvtsi2ss_amdfam10, cvtsd2ss_load_amdfam10, + cvtsd2ss_amdfam10, cvtpd2ps_load_amdfam10, cvtpd2ps_amdfam10, + cvtsX2si_load_amdfam10, cvtsX2si_amdfam10): New + define_insn_reservation. + + * config/i386/sse.md (cvtsi2ss, cvtsi2ssq, cvtss2si, + cvtss2siq, cvttss2si, cvttss2siq, cvtsi2sd, cvtsi2sdq, + cvtsd2si, cvtsd2siq, cvttsd2si, cvttsd2siq, + cvtpd2dq, cvttpd2dq, cvtsd2ss, cvtss2sd, + cvtpd2ps, cvtps2pd): Added amdfam10_decode attribute. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_ssedivvector_amdfam10, + athlon_ssedivvector_load_amdfam10, athlon_ssemulvector_amdfam10, + athlon_ssemulvector_load_amdfam10): New define_insn_reservation. + (athlon_ssediv, athlon_ssediv_load_k8, athlon_ssemul, + athlon_ssemul_load_k8): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_SSE_UNALIGNED_MOVE_OPTIMAL): New macro. + (x86_sse_unaligned_move_optimal): New variable. + + * config/i386/i386.c (x86_sse_unaligned_move_optimal): Enable for + m_AMDFAM10. + (ix86_expand_vector_move_misalign): Add code to generate movupd/movups + for unaligned vector SSE double/single precision loads for AMDFAM10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_AMDFAM10): New macro. + (TARGET_CPU_CPP_BUILTINS): Add code for amdfam10. + Define TARGET_CPU_DEFAULT_amdfam10. + (TARGET_CPU_DEFAULT_NAMES): Add amdfam10. + (processor_type): Add PROCESSOR_AMDFAM10. + + * config/i386/i386.md: Add amdfam10 as a new cpu attribute to match + processor_type in config/i386/i386.h. + Enable imul peepholes for TARGET_AMDFAM10. + + * config.gcc: Add support for --with-cpu option for amdfam10. + + * config/i386/i386.c (amdfam10_cost): New variable. + (m_AMDFAM10): New macro. + (m_ATHLON_K8_AMDFAM10): New macro. + (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen, + x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_simode_fiop, + x86_promote_QImode, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_accumulate_outgoing_args, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_sse_typeless_stores, + x86_use_ffreep, x86_use_incdec, x86_four_jump_limit, + x86_schedule, x86_use_bt, x86_cmpxchg16b, x86_pad_returns): + Enable/disable for amdfam10. + (override_options): Add amdfam10_cost to processor_target_table. + Set up PROCESSOR_AMDFAM10 for amdfam10 entry in + processor_alias_table. + (ix86_issue_rate): Add PROCESSOR_AMDFAM10. + (ix86_adjust_cost): Add code for amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.opt: Add new Advanced Bit Manipulation (-mabm) + instruction set feature flag. Add new (-mpopcnt) flag for popcnt + instruction. Add new SSE4A (-msse4a) instruction set feature flag. + * config/i386/i386.h: Add builtin definition for SSE4A. + * config/i386/i386.md: Add support for ABM instructions + (popcnt and lzcnt). + * config/i386/sse.md: Add support for SSE4A instructions + (movntss, movntsd, extrq, insertq). + * config/i386/i386.c: Add support for ABM and SSE4A builtins. + Add -march=amdfam10 flag. + * config/i386/ammintrin.h: Add support for SSE4A intrinsics. + * doc/invoke.texi: Add documentation on flags for sse4a, abm, popcnt + and amdfam10. + * doc/extend.texi: Add documentation for SSE4A builtins. + +2007-01-24 Jakub Jelinek (r121140) + + * config/i386/i386.h (x86_cmpxchg16b): Remove const. + (TARGET_CMPXCHG16B): Define to x86_cmpxchg16b. + * config/i386/i386.c (x86_cmpxchg16b): Remove const. + (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b + for CPUs that have PTA_CX16 set. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. @@ -47,6 +231,11 @@ PR target/30040 * config/i386/driver-i386.c (bit_SSSE3): New. +2006-11-27 Uros Bizjak (r119260) + + * config/i386/i386.c (x86_ext_80387_constants): Add m_K8, m_CORE2 + and m_GENERIC64. + 2006-11-18 Vladimir Makarov (r118973) * doc/invoke.texi (core2): Add item. @@ -182,7 +371,7 @@ * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. -2006-10-22 H.J. Lu +2006-10-22 H.J. Lu (r117959) * config/i386/tmmintrin.h: Remove the duplicated content. Modified: head/contrib/gcc/config.gcc ============================================================================== --- head/contrib/gcc/config.gcc Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/config.gcc Sat Jun 1 01:02:24 2013 (r251212) @@ -269,12 +269,12 @@ xscale-*-*) i[34567]86-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" ;; x86_64-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" need_64bit_hwint=yes ;; ia64-*-*) @@ -1209,14 +1209,14 @@ i[34567]86-*-solaris2*) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 exit 1 ;; esac @@ -2515,6 +2515,9 @@ if test x$with_cpu = x ; then ;; i686-*-* | i786-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2555,6 +2558,9 @@ if test x$with_cpu = x ; then ;; x86_64-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2795,7 +2801,7 @@ case "${target}" in esac # OK ;; - "" | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) + "" | amdfam10 | barcelona | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) Added: head/contrib/gcc/config/i386/ammintrin.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/i386/ammintrin.h Sat Jun 1 01:02:24 2013 (r251212) @@ -0,0 +1,73 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the AMD Programmers + Manual Update, version 2.x */ + +#ifndef _AMMINTRIN_H_INCLUDED +#define _AMMINTRIN_H_INCLUDED + +#ifndef __SSE4A__ +# error "SSE4A instruction set not enabled" +#else + +/* We need definitions from the SSE3, SSE2 and SSE header files*/ +#include + +static __inline void __attribute__((__always_inline__)) +_mm_stream_sd (double * __P, __m128d __Y) +{ + __builtin_ia32_movntsd (__P, (__v2df) __Y); +} + +static __inline void __attribute__((__always_inline__)) +_mm_stream_ss (float * __P, __m128 __Y) +{ + __builtin_ia32_movntss (__P, (__v4sf) __Y); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_extract_si64 (__m128i __X, __m128i __Y) +{ + return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y); +} + +#define _mm_extracti_si64(X, I, L) \ +((__m128i) __builtin_ia32_extrqi ((__v2di)(X), I, L)) + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_si64 (__m128i __X,__m128i __Y) +{ + return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y); +} + +#define _mm_inserti_si64(X, Y, I, L) \ +((__m128i) __builtin_ia32_insertqi ((__v2di)(X), (__v2di)(Y), I, L)) + + +#endif /* __SSE4A__ */ + +#endif /* _AMMINTRIN_H_INCLUDED */ Modified: head/contrib/gcc/config/i386/athlon.md ============================================================================== --- head/contrib/gcc/config/i386/athlon.md Fri May 31 22:57:04 2013 (r251211) +++ head/contrib/gcc/config/i386/athlon.md Sat Jun 1 01:02:24 2013 (r251212) @@ -29,6 +29,8 @@ (const_string "vector")] (const_string "direct"))) +(define_attr "amdfam10_decode" "direct,vector,double" + (const_string "direct")) ;; ;; decode0 decode1 decode2 ;; \ | / @@ -131,18 +133,22 @@ ;; Jump instructions are executed in the branch unit completely transparent to us (define_insn_reservation "athlon_branch" 0 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "ibr")) "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_call" 0 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "call,callv")) "athlon-vector,athlon-ieu") +(define_insn_reservation "athlon_call_amdfam10" 0 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "call,callv")) + "athlon-double,athlon-ieu") ;; Latency of push operation is 3 cycles, but ESP value is available ;; earlier (define_insn_reservation "athlon_push" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "push")) "athlon-direct,athlon-agu,athlon-store") (define_insn_reservation "athlon_pop" 4 @@ -153,12 +159,16 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "pop")) "athlon-double,(athlon-ieu+athlon-load)") +(define_insn_reservation "athlon_pop_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "pop")) + "athlon-direct,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "leave")) "athlon-vector,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "leave")) "athlon-double,(athlon-ieu+athlon-load)") @@ -167,6 +177,11 @@ (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "lea")) "athlon-direct,athlon-agu,nothing") +;; Lea executes in AGU unit with 1 cycle latency on AMDFAM10 +(define_insn_reservation "athlon_lea_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "lea")) + "athlon-direct,athlon-agu,nothing") ;; Mul executes in special multiplier unit attached to IEU0 (define_insn_reservation "athlon_imul" 5 @@ -176,29 +191,35 @@ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0") ;; ??? Widening multiply is vector or double. (define_insn_reservation "athlon_imul_k8_DI" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "none,unknown")))) "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "none,unknown"))) "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0") +(define_insn_reservation "athlon_imul_amdfam10_HI" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "imul") + (and (eq_attr "mode" "HI") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_mem" 8 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8_DI" 7 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "load,both")))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu") @@ -209,21 +230,23 @@ ;; other instructions. ;; ??? Experiments show that the idiv can overlap with roughly 6 cycles ;; of the other code +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_idiv" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "none,unknown"))) "athlon-vector,(athlon-ieu0*6+(athlon-fpsched,athlon-fvector))") (define_insn_reservation "athlon_idiv_mem" 9 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "load,both"))) "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))") ;; The parallelism of string instructions is not documented. Model it same way ;; as idiv to create smaller automata. This probably does not matter much. +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_str" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "str") (eq_attr "memory" "load,both,store"))) "athlon-vector,athlon-load,athlon-ieu0*6") @@ -234,34 +257,62 @@ (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-direct,athlon-ieu") +(define_insn_reservation "athlon_idirect_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_ivector" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-vector,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_loadmov" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "load"))) "athlon-direct,athlon-load") + (define_insn_reservation "athlon_idirect_load" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-direct,athlon-load,athlon-ieu") +(define_insn_reservation "athlon_idirect_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-direct,athlon-load,athlon-ieu") (define_insn_reservation "athlon_ivector_load" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_movstore" 1 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "store"))) "athlon-direct,athlon-agu,athlon-store") + (define_insn_reservation "athlon_idirect_both" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -270,6 +321,15 @@ "athlon-direct,athlon-load, athlon-ieu,athlon-store, athlon-store") +(define_insn_reservation "athlon_idirect_both_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-direct,athlon-load, + athlon-ieu,athlon-store, + athlon-store") + (define_insn_reservation "athlon_ivector_both" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -279,6 +339,16 @@ athlon-ieu, athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_both_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-vector,athlon-load, + athlon-ieu, + athlon-ieu, + athlon-store") + (define_insn_reservation "athlon_idirect_store" 1 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -286,6 +356,14 @@ (eq_attr "memory" "store")))) "athlon-direct,(athlon-ieu+athlon-agu), athlon-store") +(define_insn_reservation "athlon_idirect_store_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-direct,(athlon-ieu+athlon-agu), + athlon-store") + (define_insn_reservation "athlon_ivector_store" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -293,6 +371,13 @@ (eq_attr "memory" "store")))) "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_store_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, + athlon-store") ;; Athlon floatin point unit (define_insn_reservation "athlon_fldxf" 12 @@ -302,7 +387,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,athlon-fpload2,athlon-fvector*9") (define_insn_reservation "athlon_fldxf_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "load") (eq_attr "mode" "XF")))) @@ -314,7 +399,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fany") (define_insn_reservation "athlon_fld_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") @@ -326,7 +411,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,(athlon-fpsched+athlon-agu),(athlon-store2+(athlon-fvector*7))") (define_insn_reservation "athlon_fstxf_k8" 8 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "store,both") (eq_attr "mode" "XF")))) @@ -337,16 +422,16 @@ (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fst_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fist" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fistp,fisttp")) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fmov" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmov")) "athlon-direct,athlon-fpsched,athlon-faddmul") (define_insn_reservation "athlon_fadd_load" 4 @@ -355,12 +440,12 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fop") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fop")) "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_fmul_load" 4 @@ -369,16 +454,16 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fmul_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmul") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") (define_insn_reservation "athlon_fmul" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmul")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fsgn" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fsgn")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_load" 24 @@ -387,7 +472,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fdiv_load_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fdiv") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") @@ -396,16 +481,16 @@ (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_k8" 11 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fpspc_load" 103 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "fpspc") (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload,athlon-fvector") (define_insn_reservation "athlon_fpspc" 100 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fpspc")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load" 7 @@ -418,12 +503,12 @@ (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load_k8" 17 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmov") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fvector") (define_insn_reservation "athlon_fcmov_k8" 15 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") ;; fcomi is vector decoded by uses only one pipe. @@ -434,13 +519,13 @@ (eq_attr "memory" "load")))) "athlon-vector,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcomi_load_k8" 5 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (and (eq_attr "athlon_decode" "vector") (eq_attr "memory" "load")))) "athlon-vector,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcomi" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "athlon_decode" "vector") (eq_attr "type" "fcmp"))) "athlon-vector,athlon-fpsched,athlon-fadd") @@ -450,18 +535,18 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcom_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcom" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fcmp")) "athlon-direct,athlon-fpsched,athlon-fadd") ;; Never seen by the scheduler because we still don't do post reg-stack ;; scheduling. ;(define_insn_reservation "athlon_fxch" 2 -; (and (eq_attr "cpu" "athlon,k8,generic64") +; (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") ; (eq_attr "type" "fxch")) ; "athlon-direct,athlon-fpsched,athlon-fany") @@ -516,6 +601,23 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") +;; On AMDFAM10 all double, single and integer packed and scalar SSEx data +;; loads generated are direct path, latency of 2 and do not use any FP +;; executions units. No seperate entries for movlpx/movhpx loads, which +;; are direct path, latency of 4 and use the FADD/FMUL FP execution units, +;; as they will not be generated. +(define_insn_reservation "athlon_sseld_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8") +;; On AMDFAM10 MMX data loads generated are direct path, latency of 4 +;; and can use any FP executions units +(define_insn_reservation "athlon_mmxld_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8, athlon-fany") (define_insn_reservation "athlon_mmxssest" 3 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") @@ -533,6 +635,25 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") +;; On AMDFAM10 all double, single and integer packed SSEx data stores +;; generated are all double path, latency of 2 and use the FSTORE FP +;; execution unit. No entries seperate for movupx/movdqu, which are +;; vector path, latency of 3 and use the FSTORE*2 FP execution unit, +;; as they will not be generated. +(define_insn_reservation "athlon_ssest_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (and (eq_attr "mode" "V4SF,V2DF,TI") + (eq_attr "memory" "store,both")))) + "athlon-double,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store)*2)") +;; On AMDFAM10 all double, single and integer scalar SSEx and MMX +;; data stores generated are all direct path, latency of 2 and use +;; the FSTORE FP execution unit +(define_insn_reservation "athlon_mmxssest_short_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov,ssemov") + (eq_attr "memory" "store,both"))) + "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_movaps_k8" 2 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") @@ -578,6 +699,11 @@ (and (eq_attr "type" "sselog,sselog1") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fmul*2)") +(define_insn_reservation "athlon_sselog_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sselog,sselog1") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,(athlon-fadd|athlon-fmul)") (define_insn_reservation "athlon_sselog" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sselog,sselog1")) @@ -586,6 +712,11 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sselog,sselog1")) "athlon-double,athlon-fpsched,athlon-fmul") +(define_insn_reservation "athlon_sselog_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sselog,sselog1")) + "athlon-direct,athlon-fpsched,(athlon-fadd|athlon-fmul)") + ;; ??? pcmp executes in addmul, probably not worthwhile to bother about that. (define_insn_reservation "athlon_ssecmp_load" 2 (and (eq_attr "cpu" "athlon") @@ -594,13 +725,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_ssecmp_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (and (eq_attr "mode" "SF,DF,DI,TI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmp" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (eq_attr "mode" "SF,DF,DI,TI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -614,6 +745,11 @@ (and (eq_attr "type" "ssecmp") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecmp") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmpvector" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "ssecmp")) @@ -622,6 +758,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssecmp")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "ssecmp")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_ssecomi_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssecomi") @@ -632,10 +772,20 @@ (and (eq_attr "type" "ssecomi") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_load_amdfam10" 5 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecomi") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecomi" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "ssecmp")) "athlon-vector,athlon-fpsched,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") +;; It seems athlon_ssecomi has a bug in the attr_type, fixed for amdfam10 + (eq_attr "type" "ssecomi")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_sseadd_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "sseadd") @@ -643,13 +793,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_sseadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (and (eq_attr "mode" "SF,DF,DI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (eq_attr "mode" "SF,DF,DI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -663,6 +813,11 @@ (and (eq_attr "type" "sseadd") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sseadd") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseaddvector" 5 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sseadd")) @@ -671,6 +826,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sseadd")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sseadd")) + "athlon-direct,athlon-fpsched,athlon-fadd") ;; Conversions behaves very irregularly and the scheduling is critical here. ;; Take each instruction separately. Assume that the mode is always set to the @@ -684,12 +843,25 @@ (and (eq_attr "mode" "DF") (eq_attr "memory" "load"))))) "athlon-direct,athlon-fploadk8,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_load_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "double") + (and (eq_attr "mode" "DF") + (eq_attr "memory" "load"))))) + "athlon-double,athlon-fploadk8,(athlon-faddmul+athlon-fstore)") (define_insn_reservation "athlon_ssecvt_cvtss2sd" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "direct") (eq_attr "mode" "DF")))) "athlon-direct,athlon-fpsched,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "vector") + (eq_attr "mode" "DF")))) + "athlon-vector,athlon-fpsched,athlon-faddmul,(athlon-fstore*2)") ;; cvtps2pd. Model same way the other double decoded FP conversions. (define_insn_reservation "athlon_ssecvt_cvtps2pd_load_k8" 5 (and (eq_attr "cpu" "k8,athlon,generic64") @@ -698,12 +870,25 @@ (and (eq_attr "mode" "V2DF,V4SF,TI") (eq_attr "memory" "load"))))) "athlon-double,athlon-fpload2k8,(athlon-fstore*2)") +(define_insn_reservation "athlon_ssecvt_cvtps2pd_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 02:07:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 431CF692; Sat, 1 Jun 2013 02:07:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 24FCB7FD; Sat, 1 Jun 2013 02:07:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5127c2B070186; Sat, 1 Jun 2013 02:07:38 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5127c0u070185; Sat, 1 Jun 2013 02:07:38 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201306010207.r5127c0u070185@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 1 Jun 2013 02:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251213 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 02:07:38 -0000 Author: np Date: Sat Jun 1 02:07:37 2013 New Revision: 251213 URL: http://svnweb.freebsd.org/changeset/base/251213 Log: cxgbe(4): Some more debug sysctls. These work on both T4 and T5 based cards. dev.t5nex.0.misc.cim_ma_la: CIM MA logic analyzer dev.t5nex.0.misc.cim_pif_la: CIM PIF logic analyzer dev.t5nex.0.misc.mps_tcam: MPS TCAM entries dev.t5nex.0.misc.tp_la: TP logic analyzer dev.t5nex.0.misc.ulprx_la: ULPRX logic analyzer Obtained from: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Jun 1 01:02:24 2013 (r251212) +++ head/sys/dev/cxgbe/t4_main.c Sat Jun 1 02:07:37 2013 (r251213) @@ -382,6 +382,8 @@ static int sysctl_handle_t4_reg64(SYSCTL static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); static int sysctl_cim_la(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS); static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); @@ -390,13 +392,16 @@ static int sysctl_fcoe_stats(SYSCTL_HAND static int sysctl_hw_sched(SYSCTL_HANDLER_ARGS); static int sysctl_lb_stats(SYSCTL_HANDLER_ARGS); static int sysctl_meminfo(SYSCTL_HANDLER_ARGS); +static int sysctl_mps_tcam(SYSCTL_HANDLER_ARGS); static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS); static int sysctl_pm_stats(SYSCTL_HANDLER_ARGS); static int sysctl_rdma_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tcp_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tids(SYSCTL_HANDLER_ARGS); static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_tp_la(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); +static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); #endif static inline void txq_start(struct ifnet *, struct sge_txq *); @@ -4220,6 +4225,10 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cim_la, "A", "CIM logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ma_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", CTLTYPE_STRING | CTLFLAG_RD, sc, 0 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); @@ -4254,6 +4263,10 @@ t4_sysctls(struct adapter *sc) sysctl_cim_ibq_obq, "A", "CIM OBQ 7 (SGE1-RX)"); } + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_pif_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cim_qcfg, "A", "CIM queue configuration"); @@ -4290,6 +4303,10 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_meminfo, "A", "memory regions"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mps_tcam", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_mps_tcam, "A", "MPS TCAM entries"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "path_mtus", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_path_mtus, "A", "path MTUs"); @@ -4314,10 +4331,18 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_err_stats, "A", "TP error statistics"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_tp_la, "A", "TP logic analyzer"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tx_rate, "A", "Tx rate"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ulprx_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_ulprx_la, "A", "ULPRX logic analyzer"); + if (is_t5(sc)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wcwr_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, @@ -4912,6 +4937,92 @@ done: } static int +sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int i; + struct sbuf *sb; + uint32_t *buf, *p; + int rc; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(2 * CIM_MALA_SIZE * 5 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_cim_read_ma_la(sc, buf, buf + 5 * CIM_MALA_SIZE); + p = buf; + + for (i = 0; i < CIM_MALA_SIZE; i++, p += 5) { + sbuf_printf(sb, "\n%02x%08x%08x%08x%08x", p[4], p[3], p[2], + p[1], p[0]); + } + + sbuf_printf(sb, "\n\nCnt ID Tag UE Data RDY VLD"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 5) { + sbuf_printf(sb, "\n%3u %2u %x %u %08x%08x %u %u", + (p[2] >> 10) & 0xff, (p[2] >> 7) & 7, + (p[2] >> 3) & 0xf, (p[2] >> 2) & 1, + (p[1] >> 2) | ((p[2] & 3) << 30), + (p[0] >> 2) | ((p[1] & 3) << 30), (p[0] >> 1) & 1, + p[0] & 1); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int +sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int i; + struct sbuf *sb; + uint32_t *buf, *p; + int rc; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(2 * CIM_PIFLA_SIZE * 6 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_cim_read_pif_la(sc, buf, buf + 6 * CIM_PIFLA_SIZE, NULL, NULL); + p = buf; + + sbuf_printf(sb, "Cntl ID DataBE Addr Data"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 6) { + sbuf_printf(sb, "\n %02x %02x %04x %08x %08x%08x%08x%08x", + (p[5] >> 22) & 0xff, (p[5] >> 16) & 0x3f, p[5] & 0xffff, + p[4], p[3], p[2], p[1], p[0]); + } + + sbuf_printf(sb, "\n\nCntl ID Data"); + for (i = 0; i < CIM_MALA_SIZE; i++, p += 6) { + sbuf_printf(sb, "\n %02x %02x %08x%08x%08x%08x", + (p[4] >> 6) & 0xff, p[4] & 0x3f, p[3], p[2], p[1], p[0]); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; @@ -5534,6 +5645,104 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) return (rc); } +static inline void +tcamxy2valmask(uint64_t x, uint64_t y, uint8_t *addr, uint64_t *mask) +{ + *mask = x | y; + y = htobe64(y); + memcpy(addr, (char *)&y + 2, ETHER_ADDR_LEN); +} + +static int +sysctl_mps_tcam(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i, n; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, + "Idx Ethernet address Mask Vld Ports PF" + " VF Replication P0 P1 P2 P3 ML"); + n = is_t4(sc) ? NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; + for (i = 0; i < n; i++) { + uint64_t tcamx, tcamy, mask; + uint32_t cls_lo, cls_hi; + uint8_t addr[ETHER_ADDR_LEN]; + + tcamy = t4_read_reg64(sc, MPS_CLS_TCAM_Y_L(i)); + tcamx = t4_read_reg64(sc, MPS_CLS_TCAM_X_L(i)); + cls_lo = t4_read_reg(sc, MPS_CLS_SRAM_L(i)); + cls_hi = t4_read_reg(sc, MPS_CLS_SRAM_H(i)); + + if (tcamx & tcamy) + continue; + + tcamxy2valmask(tcamx, tcamy, addr, &mask); + sbuf_printf(sb, "\n%3u %02x:%02x:%02x:%02x:%02x:%02x %012jx" + " %c %#x%4u%4d", i, addr[0], addr[1], addr[2], + addr[3], addr[4], addr[5], (uintmax_t)mask, + (cls_lo & F_SRAM_VLD) ? 'Y' : 'N', + G_PORTMAP(cls_hi), G_PF(cls_lo), + (cls_lo & F_VF_VALID) ? G_VF(cls_lo) : -1); + + if (cls_lo & F_REPLICATE) { + struct fw_ldst_cmd ldst_cmd; + + memset(&ldst_cmd, 0, sizeof(ldst_cmd)); + ldst_cmd.op_to_addrspace = + htobe32(V_FW_CMD_OP(FW_LDST_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_MPS)); + ldst_cmd.cycles_to_len16 = htobe32(FW_LEN16(ldst_cmd)); + ldst_cmd.u.mps.fid_ctl = + htobe16(V_FW_LDST_CMD_FID(FW_LDST_MPS_RPLC) | + V_FW_LDST_CMD_CTL(i)); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, + "t4mps"); + if (rc) + break; + rc = -t4_wr_mbox(sc, sc->mbox, &ldst_cmd, + sizeof(ldst_cmd), &ldst_cmd); + end_synchronized_op(sc, 0); + + if (rc != 0) { + sbuf_printf(sb, + " ------------ error %3u ------------", rc); + rc = 0; + } else { + sbuf_printf(sb, " %08x %08x %08x %08x", + be32toh(ldst_cmd.u.mps.rplc127_96), + be32toh(ldst_cmd.u.mps.rplc95_64), + be32toh(ldst_cmd.u.mps.rplc63_32), + be32toh(ldst_cmd.u.mps.rplc31_0)); + } + } else + sbuf_printf(sb, "%36s", ""); + + sbuf_printf(sb, "%4u%3u%3u%3u %#3x", G_SRAM_PRIO0(cls_lo), + G_SRAM_PRIO1(cls_lo), G_SRAM_PRIO2(cls_lo), + G_SRAM_PRIO3(cls_lo), (cls_lo >> S_MULTILISTEN0) & 0xf); + } + + if (rc) + (void) sbuf_finish(sb); + else + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS) { @@ -5771,6 +5980,242 @@ sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS) return (rc); } +struct field_desc { + const char *name; + u_int start; + u_int width; +}; + +static void +field_desc_show(struct sbuf *sb, uint64_t v, const struct field_desc *f) +{ + char buf[32]; + int line_size = 0; + + while (f->name) { + uint64_t mask = (1ULL << f->width) - 1; + int len = snprintf(buf, sizeof(buf), "%s: %ju", f->name, + ((uintmax_t)v >> f->start) & mask); + + if (line_size + len >= 79) { + line_size = 8; + sbuf_printf(sb, "\n "); + } + sbuf_printf(sb, "%s ", buf); + line_size += len + 1; + f++; + } + sbuf_printf(sb, "\n"); +} + +static struct field_desc tp_la0[] = { + { "RcfOpCodeOut", 60, 4 }, + { "State", 56, 4 }, + { "WcfState", 52, 4 }, + { "RcfOpcSrcOut", 50, 2 }, + { "CRxError", 49, 1 }, + { "ERxError", 48, 1 }, + { "SanityFailed", 47, 1 }, + { "SpuriousMsg", 46, 1 }, + { "FlushInputMsg", 45, 1 }, + { "FlushInputCpl", 44, 1 }, + { "RssUpBit", 43, 1 }, + { "RssFilterHit", 42, 1 }, + { "Tid", 32, 10 }, + { "InitTcb", 31, 1 }, + { "LineNumber", 24, 7 }, + { "Emsg", 23, 1 }, + { "EdataOut", 22, 1 }, + { "Cmsg", 21, 1 }, + { "CdataOut", 20, 1 }, + { "EreadPdu", 19, 1 }, + { "CreadPdu", 18, 1 }, + { "TunnelPkt", 17, 1 }, + { "RcfPeerFin", 16, 1 }, + { "RcfReasonOut", 12, 4 }, + { "TxCchannel", 10, 2 }, + { "RcfTxChannel", 8, 2 }, + { "RxEchannel", 6, 2 }, + { "RcfRxChannel", 5, 1 }, + { "RcfDataOutSrdy", 4, 1 }, + { "RxDvld", 3, 1 }, + { "RxOoDvld", 2, 1 }, + { "RxCongestion", 1, 1 }, + { "TxCongestion", 0, 1 }, + { NULL } +}; + +static struct field_desc tp_la1[] = { + { "CplCmdIn", 56, 8 }, + { "CplCmdOut", 48, 8 }, + { "ESynOut", 47, 1 }, + { "EAckOut", 46, 1 }, + { "EFinOut", 45, 1 }, + { "ERstOut", 44, 1 }, + { "SynIn", 43, 1 }, + { "AckIn", 42, 1 }, + { "FinIn", 41, 1 }, + { "RstIn", 40, 1 }, + { "DataIn", 39, 1 }, + { "DataInVld", 38, 1 }, + { "PadIn", 37, 1 }, + { "RxBufEmpty", 36, 1 }, + { "RxDdp", 35, 1 }, + { "RxFbCongestion", 34, 1 }, + { "TxFbCongestion", 33, 1 }, + { "TxPktSumSrdy", 32, 1 }, + { "RcfUlpType", 28, 4 }, + { "Eread", 27, 1 }, + { "Ebypass", 26, 1 }, + { "Esave", 25, 1 }, + { "Static0", 24, 1 }, + { "Cread", 23, 1 }, + { "Cbypass", 22, 1 }, + { "Csave", 21, 1 }, + { "CPktOut", 20, 1 }, + { "RxPagePoolFull", 18, 2 }, + { "RxLpbkPkt", 17, 1 }, + { "TxLpbkPkt", 16, 1 }, + { "RxVfValid", 15, 1 }, + { "SynLearned", 14, 1 }, + { "SetDelEntry", 13, 1 }, + { "SetInvEntry", 12, 1 }, + { "CpcmdDvld", 11, 1 }, + { "CpcmdSave", 10, 1 }, + { "RxPstructsFull", 8, 2 }, + { "EpcmdDvld", 7, 1 }, + { "EpcmdFlush", 6, 1 }, + { "EpcmdTrimPrefix", 5, 1 }, + { "EpcmdTrimPostfix", 4, 1 }, + { "ERssIp4Pkt", 3, 1 }, + { "ERssIp6Pkt", 2, 1 }, + { "ERssTcpUdpPkt", 1, 1 }, + { "ERssFceFipPkt", 0, 1 }, + { NULL } +}; + +static struct field_desc tp_la2[] = { + { "CplCmdIn", 56, 8 }, + { "MpsVfVld", 55, 1 }, + { "MpsPf", 52, 3 }, + { "MpsVf", 44, 8 }, + { "SynIn", 43, 1 }, + { "AckIn", 42, 1 }, + { "FinIn", 41, 1 }, + { "RstIn", 40, 1 }, + { "DataIn", 39, 1 }, + { "DataInVld", 38, 1 }, + { "PadIn", 37, 1 }, + { "RxBufEmpty", 36, 1 }, + { "RxDdp", 35, 1 }, + { "RxFbCongestion", 34, 1 }, + { "TxFbCongestion", 33, 1 }, + { "TxPktSumSrdy", 32, 1 }, + { "RcfUlpType", 28, 4 }, + { "Eread", 27, 1 }, + { "Ebypass", 26, 1 }, + { "Esave", 25, 1 }, + { "Static0", 24, 1 }, + { "Cread", 23, 1 }, + { "Cbypass", 22, 1 }, + { "Csave", 21, 1 }, + { "CPktOut", 20, 1 }, + { "RxPagePoolFull", 18, 2 }, + { "RxLpbkPkt", 17, 1 }, + { "TxLpbkPkt", 16, 1 }, + { "RxVfValid", 15, 1 }, + { "SynLearned", 14, 1 }, + { "SetDelEntry", 13, 1 }, + { "SetInvEntry", 12, 1 }, + { "CpcmdDvld", 11, 1 }, + { "CpcmdSave", 10, 1 }, + { "RxPstructsFull", 8, 2 }, + { "EpcmdDvld", 7, 1 }, + { "EpcmdFlush", 6, 1 }, + { "EpcmdTrimPrefix", 5, 1 }, + { "EpcmdTrimPostfix", 4, 1 }, + { "ERssIp4Pkt", 3, 1 }, + { "ERssIp6Pkt", 2, 1 }, + { "ERssTcpUdpPkt", 1, 1 }, + { "ERssFceFipPkt", 0, 1 }, + { NULL } +}; + +static void +tp_la_show(struct sbuf *sb, uint64_t *p, int idx) +{ + + field_desc_show(sb, *p, tp_la0); +} + +static void +tp_la_show2(struct sbuf *sb, uint64_t *p, int idx) +{ + + if (idx) + sbuf_printf(sb, "\n"); + field_desc_show(sb, p[0], tp_la0); + if (idx < (TPLA_SIZE / 2 - 1) || p[1] != ~0ULL) + field_desc_show(sb, p[1], tp_la0); +} + +static void +tp_la_show3(struct sbuf *sb, uint64_t *p, int idx) +{ + + if (idx) + sbuf_printf(sb, "\n"); + field_desc_show(sb, p[0], tp_la0); + if (idx < (TPLA_SIZE / 2 - 1) || p[1] != ~0ULL) + field_desc_show(sb, p[1], (p[0] & (1 << 17)) ? tp_la2 : tp_la1); +} + +static int +sysctl_tp_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + uint64_t *buf, *p; + int rc; + u_int i, inc; + void (*show_func)(struct sbuf *, uint64_t *, int); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(TPLA_SIZE * sizeof(uint64_t), M_CXGBE, M_ZERO | M_WAITOK); + + t4_tp_read_la(sc, buf, NULL); + p = buf; + + switch (G_DBGLAMODE(t4_read_reg(sc, A_TP_DBG_LA_CONFIG))) { + case 2: + inc = 2; + show_func = tp_la_show2; + break; + case 3: + inc = 2; + show_func = tp_la_show3; + break; + default: + inc = 1; + show_func = tp_la_show; + } + + for (i = 0; i < TPLA_SIZE / inc; i++, p += inc) + (*show_func)(sb, p, i); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS) { @@ -5802,6 +6247,41 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) } static int +sysctl_ulprx_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + uint32_t *buf, *p; + int rc, i; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(ULPRX_LA_SIZE * 8 * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + t4_ulprx_read_la(sc, buf); + p = buf; + + sbuf_printf(sb, " Pcmd Type Message" + " Data"); + for (i = 0; i < ULPRX_LA_SIZE; i++, p += 8) { + sbuf_printf(sb, "\n%08x%08x %4x %08x %08x%08x%08x%08x", + p[1], p[0], p[2], p[3], p[7], p[6], p[5], p[4]); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + free(buf, M_CXGBE); + return (rc); +} + +static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 04:02:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E380C364; Sat, 1 Jun 2013 04:02:52 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC71DCD3; Sat, 1 Jun 2013 04:02:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5142pqp011662; Sat, 1 Jun 2013 04:02:51 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5142pA4011661; Sat, 1 Jun 2013 04:02:51 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201306010402.r5142pA4011661@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 1 Jun 2013 04:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251214 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 04:02:53 -0000 Author: gibbs Date: Sat Jun 1 04:02:51 2013 New Revision: 251214 URL: http://svnweb.freebsd.org/changeset/base/251214 Log: sys/dev/xen/blkfront/blkfront.c: Remove local, and incorrect, definition for the value of an invalid grant reference. Extract ring cleanup code into xbd_free_ring() function for symetry with xbd_alloc_ring(). This process also eliminated an initialized but unused variable. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 02:07:37 2013 (r251213) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:02:51 2013 (r251214) @@ -87,8 +87,6 @@ static void xbd_startio(struct xbd_softc #define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ #define XBD_SECTOR_SHFT 9 -#define GRANT_INVALID_REF 0 - /* Control whether runtime update of vbds is enabled. */ #define ENABLE_VBD_UPDATE 0 @@ -709,6 +707,24 @@ xbd_alloc_ring(struct xbd_softc *sc) return (0); } +static void +xbd_free_ring(struct xbd_softc *sc) +{ + int i; + + if (sc->xbd_ring.sring == NULL) + return; + + for (i = 0; i < sc->xbd_ring_pages; i++) { + if (sc->xbd_ring_ref[i] != GRANT_REF_INVALID) { + gnttab_end_foreign_access_ref(sc->xbd_ring_ref[i]); + sc->xbd_ring_ref[i] = GRANT_REF_INVALID; + } + } + free(sc->xbd_ring.sring, M_XENBLOCKFRONT); + sc->xbd_ring.sring = NULL; +} + /*-------------------------- Initialization/Teardown -------------------------*/ static void xbd_setup_sysctl(struct xbd_softc *xbd) @@ -846,7 +862,6 @@ xbd_instance_create(struct xbd_softc *sc static void xbd_free(struct xbd_softc *sc) { - uint8_t *sring_page_ptr; int i; /* Prevent new requests being issued until we fix things up. */ @@ -855,22 +870,7 @@ xbd_free(struct xbd_softc *sc) mtx_unlock(&sc->xbd_io_lock); /* Free resources associated with old device channel. */ - if (sc->xbd_ring.sring != NULL) { - sring_page_ptr = (uint8_t *)sc->xbd_ring.sring; - for (i = 0; i < sc->xbd_ring_pages; i++) { - grant_ref_t *ref; - - ref = &sc->xbd_ring_ref[i]; - if (*ref != GRANT_INVALID_REF) { - gnttab_end_foreign_access_ref(*ref); - *ref = GRANT_INVALID_REF; - } - sring_page_ptr += PAGE_SIZE; - } - free(sc->xbd_ring.sring, M_XENBLOCKFRONT); - sc->xbd_ring.sring = NULL; - } - + xbd_free_ring(sc); if (sc->xbd_shadow) { for (i = 0; i < sc->xbd_max_requests; i++) { @@ -1277,7 +1277,7 @@ xbd_attach(device_t dev) xbd_initq_complete(sc); xbd_initq_bio(sc); for (i = 0; i < XBD_MAX_RING_PAGES; i++) - sc->xbd_ring_ref[i] = GRANT_INVALID_REF; + sc->xbd_ring_ref[i] = GRANT_REF_INVALID; sc->xbd_dev = dev; sc->xbd_vdevice = vdevice; From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 04:07:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5178150F; Sat, 1 Jun 2013 04:07:57 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 436BCCEF; Sat, 1 Jun 2013 04:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r5147vWs012814; Sat, 1 Jun 2013 04:07:57 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r5147vGE012813; Sat, 1 Jun 2013 04:07:57 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201306010407.r5147vGE012813@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 1 Jun 2013 04:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251215 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 04:07:57 -0000 Author: gibbs Date: Sat Jun 1 04:07:56 2013 New Revision: 251215 URL: http://svnweb.freebsd.org/changeset/base/251215 Log: sys/dev/xen/blkfront/blkfront.c: Remove dead code. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:02:51 2013 (r251214) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jun 1 04:07:56 2013 (r251215) @@ -81,19 +81,8 @@ static void xbd_startio(struct xbd_softc #define DPRINTK(fmt, args...) #endif -/* XXX move to xbd_vbd.c when VBD update support is added */ -#define MAX_VBDS 64 - -#define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ #define XBD_SECTOR_SHFT 9 -/* Control whether runtime update of vbds is enabled. */ -#define ENABLE_VBD_UPDATE 0 - -#if ENABLE_VBD_UPDATE -static void vbd_update(void); -#endif - #define XBD_STATE_DISCONNECTED 0 #define XBD_STATE_CONNECTED 1 #define XBD_STATE_SUSPENDED 2 From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 08:07:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B6B1C98; Sat, 1 Jun 2013 08:07:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDB35F9; Sat, 1 Jun 2013 08:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51879i0095185; Sat, 1 Jun 2013 08:07:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51879Gw095183; Sat, 1 Jun 2013 08:07:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306010807.r51879Gw095183@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Jun 2013 08:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251216 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 08:07:09 -0000 Author: ed Date: Sat Jun 1 08:07:09 2013 New Revision: 251216 URL: http://svnweb.freebsd.org/changeset/base/251216 Log: Pull in r183033 and r183036 from LLVM trunk: Add support for optimized (non-generic) atomic libcalls. For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc) provide atomic functions that pass parameters by value and return results directly. libgcc and libcompiler-rt only provide optimized libcalls for __atomic_fetch_*, as generic libcalls on non-integer types would make little sense. This means that we can finally make __atomic_fetch_* work on architectures for which we don't provide these operations as builtins (e.g. ARM). This should fix the dreaded "cannot compile this atomic library call yet" error that would pop up once every while. This should make it possible for me to get C11 atomics working on all of our platforms. Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Sat Jun 1 04:07:56 2013 (r251215) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp Sat Jun 1 08:07:09 2013 (r251216) @@ -15,6 +15,7 @@ #include "CGCall.h" #include "CodeGenModule.h" #include "clang/AST/ASTContext.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Operator.h" @@ -317,6 +318,21 @@ EmitValToTemp(CodeGenFunction &CGF, Expr return DeclPtr; } +static void +AddDirectArgument(CodeGenFunction &CGF, CallArgList &Args, + bool UseOptimizedLibcall, llvm::Value *Val, QualType ValTy) { + if (UseOptimizedLibcall) { + // Load value and pass it to the function directly. + unsigned Align = CGF.getContext().getTypeAlignInChars(ValTy).getQuantity(); + Val = CGF.EmitLoadOfScalar(Val, false, Align, ValTy); + Args.add(RValue::get(Val), ValTy); + } else { + // Non-optimized functions always take a reference. + Args.add(RValue::get(CGF.EmitCastToVoidPtr(Val)), + CGF.getContext().VoidPtrTy); + } +} + RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest) { QualType AtomicTy = E->getPtr()->getType()->getPointeeType(); QualType MemTy = AtomicTy; @@ -424,76 +440,137 @@ RValue CodeGenFunction::EmitAtomicExpr(A // Use a library call. See: http://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary . if (UseLibcall) { + bool UseOptimizedLibcall = false; + switch (E->getOp()) { + case AtomicExpr::AO__c11_atomic_fetch_add: + case AtomicExpr::AO__atomic_fetch_add: + case AtomicExpr::AO__c11_atomic_fetch_and: + case AtomicExpr::AO__atomic_fetch_and: + case AtomicExpr::AO__c11_atomic_fetch_or: + case AtomicExpr::AO__atomic_fetch_or: + case AtomicExpr::AO__c11_atomic_fetch_sub: + case AtomicExpr::AO__atomic_fetch_sub: + case AtomicExpr::AO__c11_atomic_fetch_xor: + case AtomicExpr::AO__atomic_fetch_xor: + // For these, only library calls for certain sizes exist. + UseOptimizedLibcall = true; + break; + default: + // Only use optimized library calls for sizes for which they exist. + if (Size == 1 || Size == 2 || Size == 4 || Size == 8) + UseOptimizedLibcall = true; + break; + } - SmallVector Params; CallArgList Args; - // Size is always the first parameter - Args.add(RValue::get(llvm::ConstantInt::get(SizeTy, Size)), - getContext().getSizeType()); - // Atomic address is always the second parameter + if (!UseOptimizedLibcall) { + // For non-optimized library calls, the size is the first parameter + Args.add(RValue::get(llvm::ConstantInt::get(SizeTy, Size)), + getContext().getSizeType()); + } + // Atomic address is the first or second parameter Args.add(RValue::get(EmitCastToVoidPtr(Ptr)), getContext().VoidPtrTy); - const char* LibCallName; - QualType RetTy = getContext().VoidTy; + std::string LibCallName; + QualType RetTy; + bool HaveRetTy = false; switch (E->getOp()) { // There is only one libcall for compare an exchange, because there is no // optimisation benefit possible from a libcall version of a weak compare // and exchange. - // bool __atomic_compare_exchange(size_t size, void *obj, void *expected, + // bool __atomic_compare_exchange(size_t size, void *mem, void *expected, // void *desired, int success, int failure) + // bool __atomic_compare_exchange_N(T *mem, T *expected, T desired, + // int success, int failure) case AtomicExpr::AO__c11_atomic_compare_exchange_weak: case AtomicExpr::AO__c11_atomic_compare_exchange_strong: case AtomicExpr::AO__atomic_compare_exchange: case AtomicExpr::AO__atomic_compare_exchange_n: LibCallName = "__atomic_compare_exchange"; RetTy = getContext().BoolTy; + HaveRetTy = true; Args.add(RValue::get(EmitCastToVoidPtr(Val1)), getContext().VoidPtrTy); - Args.add(RValue::get(EmitCastToVoidPtr(Val2)), - getContext().VoidPtrTy); + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val2, MemTy); Args.add(RValue::get(Order), getContext().IntTy); Order = OrderFail; break; // void __atomic_exchange(size_t size, void *mem, void *val, void *return, // int order) + // T __atomic_exchange_N(T *mem, T val, int order) case AtomicExpr::AO__c11_atomic_exchange: case AtomicExpr::AO__atomic_exchange_n: case AtomicExpr::AO__atomic_exchange: LibCallName = "__atomic_exchange"; - Args.add(RValue::get(EmitCastToVoidPtr(Val1)), - getContext().VoidPtrTy); - Args.add(RValue::get(EmitCastToVoidPtr(Dest)), - getContext().VoidPtrTy); + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); break; // void __atomic_store(size_t size, void *mem, void *val, int order) + // void __atomic_store_N(T *mem, T val, int order) case AtomicExpr::AO__c11_atomic_store: case AtomicExpr::AO__atomic_store: case AtomicExpr::AO__atomic_store_n: LibCallName = "__atomic_store"; - Args.add(RValue::get(EmitCastToVoidPtr(Val1)), - getContext().VoidPtrTy); + RetTy = getContext().VoidTy; + HaveRetTy = true; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); break; // void __atomic_load(size_t size, void *mem, void *return, int order) + // T __atomic_load_N(T *mem, int order) case AtomicExpr::AO__c11_atomic_load: case AtomicExpr::AO__atomic_load: case AtomicExpr::AO__atomic_load_n: LibCallName = "__atomic_load"; - Args.add(RValue::get(EmitCastToVoidPtr(Dest)), - getContext().VoidPtrTy); break; -#if 0 - // These are only defined for 1-16 byte integers. It is not clear what - // their semantics would be on anything else... - case AtomicExpr::Add: LibCallName = "__atomic_fetch_add_generic"; break; - case AtomicExpr::Sub: LibCallName = "__atomic_fetch_sub_generic"; break; - case AtomicExpr::And: LibCallName = "__atomic_fetch_and_generic"; break; - case AtomicExpr::Or: LibCallName = "__atomic_fetch_or_generic"; break; - case AtomicExpr::Xor: LibCallName = "__atomic_fetch_xor_generic"; break; -#endif + // T __atomic_fetch_add_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_add: + case AtomicExpr::AO__atomic_fetch_add: + LibCallName = "__atomic_fetch_add"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_and_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_and: + case AtomicExpr::AO__atomic_fetch_and: + LibCallName = "__atomic_fetch_and"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_or_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_or: + case AtomicExpr::AO__atomic_fetch_or: + LibCallName = "__atomic_fetch_or"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_sub_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_sub: + case AtomicExpr::AO__atomic_fetch_sub: + LibCallName = "__atomic_fetch_sub"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; + // T __atomic_fetch_xor_N(T *mem, T val, int order) + case AtomicExpr::AO__c11_atomic_fetch_xor: + case AtomicExpr::AO__atomic_fetch_xor: + LibCallName = "__atomic_fetch_xor"; + AddDirectArgument(*this, Args, UseOptimizedLibcall, Val1, MemTy); + break; default: return EmitUnsupportedRValue(E, "atomic library call"); } + + // Optimized functions have the size in their name. + if (UseOptimizedLibcall) + LibCallName += "_" + llvm::utostr(Size); + // By default, assume we return a value of the atomic type. + if (!HaveRetTy) { + if (UseOptimizedLibcall) { + // Value is returned directly. + RetTy = MemTy; + } else { + // Value is returned through parameter before the order. + RetTy = getContext().VoidTy; + Args.add(RValue::get(EmitCastToVoidPtr(Dest)), + getContext().VoidPtrTy); + } + } // order is always the last parameter Args.add(RValue::get(Order), getContext().IntTy); @@ -504,7 +581,7 @@ RValue CodeGenFunction::EmitAtomicExpr(A llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FuncInfo); llvm::Constant *Func = CGM.CreateRuntimeFunction(FTy, LibCallName); RValue Res = EmitCall(FuncInfo, Func, ReturnValueSlot(), Args); - if (E->isCmpXChg()) + if (!RetTy->isVoidType()) return Res; if (E->getType()->isVoidType()) return RValue::get(0); From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 11:27:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48881505; Sat, 1 Jun 2013 11:27:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2665EBDD; Sat, 1 Jun 2013 11:27:58 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-244.nwrknj.fios.verizon.net [173.70.85.244]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7E0E5B94F; Sat, 1 Jun 2013 07:27:53 -0400 (EDT) From: John Baldwin To: "David E. O'Brien" Subject: Re: svn commit: r251198 - head/sys/compat/freebsd32 Date: Sat, 1 Jun 2013 07:18:43 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201305312143.r4VLhIAr077972@svn.freebsd.org> In-Reply-To: <201305312143.r4VLhIAr077972@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201306010718.43795.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 01 Jun 2013 07:27:53 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 11:27:58 -0000 On Friday, May 31, 2013 05:43:18 PM David E. O'Brien wrote: > Author: obrien > Date: Fri May 31 21:43:17 2013 > New Revision: 251198 > URL: http://svnweb.freebsd.org/changeset/base/251198 > > Log: > Add a "kern.features" MIB for 32bit support under a 64bit kernel. I suggest calling it 'compat_freebsd32' to match the kernel option name. We've already decided that compat_freebsd32 does not actually mean compatiblity with FreeBSD 32.x in terms of our kernel option naming. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 11:31:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D143F7FE; Sat, 1 Jun 2013 11:31:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33B9DBF4; Sat, 1 Jun 2013 11:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51BVAso066368; Sat, 1 Jun 2013 11:31:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BVAI8066367; Sat, 1 Jun 2013 11:31:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306011131.r51BVAI8066367@svn.freebsd.org> From: John Baldwin Date: Sat, 1 Jun 2013 11:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251220 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 11:31:10 -0000 Author: jhb Date: Sat Jun 1 11:31:09 2013 New Revision: 251220 URL: http://svnweb.freebsd.org/changeset/base/251220 Log: Remove an unused macro we originally got from BSD/OS. Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Jun 1 11:14:35 2013 (r251219) +++ head/sys/sys/mutex.h Sat Jun 1 11:31:09 2013 (r251220) @@ -426,12 +426,6 @@ do { \ } #endif -#define UGAR(rval) do { \ - int _val = (rval); \ - mtx_unlock(&Giant); \ - return (_val); \ -} while (0) - struct mtx_args { void *ma_mtx; const char *ma_desc; From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 11:42:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 27FC7B64; Sat, 1 Jun 2013 11:42:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD60C47; Sat, 1 Jun 2013 11:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51Bglcm070028; Sat, 1 Jun 2013 11:42:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51BglSK070027; Sat, 1 Jun 2013 11:42:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306011142.r51BglSK070027@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Jun 2013 11:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251221 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 11:42:48 -0000 Author: marius Date: Sat Jun 1 11:42:47 2013 New Revision: 251221 URL: http://svnweb.freebsd.org/changeset/base/251221 Log: Move an assertion to the right spot; only bus_dmamap_load_mbuf(9) requires a pkthdr being present but that's not the case for either _bus_dmamap_load_mbuf_sg() or bus_dmamap_load_mbuf_sg(9). Reported by: sbruno MFC after: 1 week Modified: head/sys/kern/subr_bus_dma.c Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sat Jun 1 11:31:09 2013 (r251220) +++ head/sys/kern/subr_bus_dma.c Sat Jun 1 11:42:47 2013 (r251221) @@ -104,8 +104,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d struct mbuf *m; int error; - M_ASSERTPKTHDR(m0); - error = 0; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { @@ -323,6 +321,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dma_segment_t *segs; int nsegs, error; + M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; nsegs = -1; error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, NULL, &nsegs, flags); From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 12:22:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3ADCA2AC; Sat, 1 Jun 2013 12:22:00 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0A5E10; Sat, 1 Jun 2013 12:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51CM0L0085050; Sat, 1 Jun 2013 12:22:00 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51CM0uN085044; Sat, 1 Jun 2013 12:22:00 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201306011222.r51CM0uN085044@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 1 Jun 2013 12:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251222 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 12:22:00 -0000 Author: nyan Date: Sat Jun 1 12:21:59 2013 New Revision: 251222 URL: http://svnweb.freebsd.org/changeset/base/251222 Log: MFi386: revision 251039 Use slightly more idiomatic expression to get the address of array. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Jun 1 11:42:47 2013 (r251221) +++ head/sys/pc98/pc98/machdep.c Sat Jun 1 12:21:59 2013 (r251222) @@ -2789,7 +2789,7 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); #endif From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 12:27:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79CD0472; Sat, 1 Jun 2013 12:27:49 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53CA1E27; Sat, 1 Jun 2013 12:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51CRm1p086046; Sat, 1 Jun 2013 12:27:48 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51CRmtv086045; Sat, 1 Jun 2013 12:27:48 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201306011227.r51CRmtv086045@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 1 Jun 2013 12:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251223 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 12:27:49 -0000 Author: nyan Date: Sat Jun 1 12:27:48 2013 New Revision: 251223 URL: http://svnweb.freebsd.org/changeset/base/251223 Log: MFi386: revision 245848 Always update the hw.uart.console hint. Modified: head/sys/boot/pc98/libpc98/comconsole.c Modified: head/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- head/sys/boot/pc98/libpc98/comconsole.c Sat Jun 1 12:21:59 2013 (r251222) +++ head/sys/boot/pc98/libpc98/comconsole.c Sat Jun 1 12:27:48 2013 (r251223) @@ -50,7 +50,6 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); -static void set_hw_console_hint(void); static int comc_ischar(void); static int comc_parseint(const char *string); static uint32_t comc_parse_pcidev(const char *string); @@ -202,27 +201,14 @@ comc_port_set(struct env_var *ev, int fl } if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_port != port) { + comc_port != port) comc_setup(comc_curspeed, port); - set_hw_console_hint(); - } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); return (CMD_OK); } -static void -set_hw_console_hint(void) -{ - char intbuf[64]; - - unsetenv("hw.uart.console"); - sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); - env_setenv("hw.uart.console", EV_VOLATILE, intbuf, - env_noset, env_nounset); -} - /* * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] @@ -288,7 +274,6 @@ comc_pcidev_handle(uint32_t locator) comc_port_set, env_nounset); comc_setup(comc_curspeed, port); - set_hw_console_hint(); comc_locator = locator; return (CMD_OK); @@ -318,8 +303,10 @@ static void comc_setup(int speed, int port) { static int TRY_COUNT = 1000000; + char intbuf[64]; int tries; + unsetenv("hw.uart.console"); comc_curspeed = speed; comc_port = port; @@ -334,9 +321,11 @@ comc_setup(int speed, int port) inb(comc_port + com_data); while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); - if (tries < TRY_COUNT) + if (tries < TRY_COUNT) { comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); - else + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); + } else comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 14:16:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8BFAE9CE; Sat, 1 Jun 2013 14:16:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3A6155; Sat, 1 Jun 2013 14:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51EGrac024564; Sat, 1 Jun 2013 14:16:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51EGq41024554; Sat, 1 Jun 2013 14:16:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306011416.r51EGq41024554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 14:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251225 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 14:16:53 -0000 Author: pfg Date: Sat Jun 1 14:16:51 2013 New Revision: 251225 URL: http://svnweb.freebsd.org/changeset/base/251225 Log: BFD: Use time_t instead of long for archive timestamps. This basically follows the suggestion in the binutils code and is more in line with what BSD ar(1) does. Obtained from: OpenBSD MFC after: 2 weeks. Modified: head/contrib/binutils/bfd/archive.c head/contrib/binutils/bfd/bfd-in2.h head/contrib/binutils/bfd/bfdio.c head/contrib/binutils/bfd/coff-rs6000.c head/contrib/binutils/bfd/ecoff.c head/contrib/binutils/bfd/libbfd-in.h head/contrib/binutils/bfd/libbfd.h Modified: head/contrib/binutils/bfd/archive.c ============================================================================== --- head/contrib/binutils/bfd/archive.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 14:16:51 2013 (r251225) @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c /* ar headers are space padded, not null padded! */ memset (hdr, ' ', sizeof (struct ar_hdr)); - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", - status.st_mtime); + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", + (long long)status.st_mtime); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, st if (aloser == hdr->arelt) \ return -1; +#define fooll(arelt, stelt, size) \ + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ + if (aloser == hdr->arelt) \ + return -1; + /* Some platforms support special notations for large IDs. */ #ifdef HPUX_LARGE_AR_IDS # define foo2(arelt, stelt, size) \ @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st # define foo2(arelt, stelt, size) foo (arelt, stelt, size) #endif - foo (ar_date, st_mtime, 10); + fooll (ar_date, st_mtime, 10); foo2 (ar_uid, st_uid, 10); foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); Modified: head/contrib/binutils/bfd/bfd-in2.h ============================================================================== --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 14:16:51 2013 (r251225) @@ -38,6 +38,7 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include /* time_t */ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) #ifndef SABER /* This hack is to avoid a problem with some strict ANSI C preprocessors. @@ -1141,7 +1142,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se /* Extracted from bfdio.c. */ -long bfd_get_mtime (bfd *abfd); +time_t bfd_get_mtime (bfd *abfd); file_ptr bfd_get_size (bfd *abfd); Modified: head/contrib/binutils/bfd/bfdio.c ============================================================================== --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 14:16:51 2013 (r251225) @@ -377,7 +377,7 @@ FUNCTION bfd_get_mtime SYNOPSIS - long bfd_get_mtime (bfd *abfd); + time_t bfd_get_mtime (bfd *abfd); DESCRIPTION Return the file modification time (as read from the file system, or @@ -385,7 +385,7 @@ DESCRIPTION */ -long +time_t bfd_get_mtime (bfd *abfd) { struct stat buf; Modified: head/contrib/binutils/bfd/coff-rs6000.c ============================================================================== --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 14:16:51 2013 (r251225) @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1678,6 +1678,7 @@ xcoff_write_armap_old (abfd, elength, ma static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define FMT20 "%-20lld" #define FMT12 "%-12d" +#define FMT12_LL "%-12lld" #define FMT12_OCTAL "%-12o" #define FMT4 "%-4d" #define PRINT20(d, v) \ @@ -1688,6 +1689,10 @@ static char buff20[XCOFFARMAGBIG_ELEMENT sprintf (buff20, FMT12, (int)(v)), \ memcpy ((void *) (d), buff20, 12) +#define PRINT12_LL(d, v) \ + sprintf (buff20, FMT12_LL, (long long)(v)), \ + memcpy ((void *) (d), buff20, 12) + #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ memcpy ((void *) (d), buff20, 12) @@ -2152,7 +2157,7 @@ xcoff_write_archive_contents_old (abfd) } sprintf (ahdrp->size, "%ld", (long) s.st_size); - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); + sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); sprintf (ahdrp->uid, "%ld", (long) s.st_uid); sprintf (ahdrp->gid, "%ld", (long) s.st_gid); sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); @@ -2388,7 +2393,7 @@ xcoff_write_archive_contents_big (abfd) } PRINT20 (ahdrp->size, s.st_size); - PRINT12 (ahdrp->date, s.st_mtime); + PRINT12_LL (ahdrp->date, s.st_mtime); PRINT12 (ahdrp->uid, s.st_uid); PRINT12 (ahdrp->gid, s.st_gid); PRINT12_OCTAL (ahdrp->mode, s.st_mode); Modified: head/contrib/binutils/bfd/ecoff.c ============================================================================== --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 14:16:51 2013 (r251225) @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, linker just checks the archive name; the GNU linker may check the date. */ stat (abfd->filename, &statbuf); - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); + sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); /* The DECstation uses zeroes for the uid, gid and mode of the armap. */ Modified: head/contrib/binutils/bfd/libbfd-in.h ============================================================================== --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 14:16:51 2013 (r251225) @@ -71,8 +71,7 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - /* when more compilers are standard C, this can be a time_t */ - long armap_timestamp; /* Timestamp value written into armap. + time_t armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, Modified: head/contrib/binutils/bfd/libbfd.h ============================================================================== --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 13:10:24 2013 (r251224) +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 14:16:51 2013 (r251225) @@ -76,8 +76,7 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - /* when more compilers are standard C, this can be a time_t */ - long armap_timestamp; /* Timestamp value written into armap. + time_t armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 17:39:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04CCBD70 for ; Sat, 1 Jun 2013 17:39:14 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx1.freebsd.org (Postfix) with ESMTP id B9E728B8 for ; Sat, 1 Jun 2013 17:39:13 +0000 (UTC) Received: by mail-vc0-f177.google.com with SMTP id ia10so1149297vcb.36 for ; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=FGJCg0dfbYTazk5e0bViUkclICVZRmTVrpWG4PBowMjphdQFkI9M7gW32wd2KKHo5R 0rPCROe0H+B0ekgO+A9l4/9xC1SKEtAwDcXepsUkL4AQgCaX/xcNBDAldpwT2MeE0Mnx 88fXFdWNf5TnGxLPP3tigwNVr062U3CV5A27U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=hQRVzddA9qbwgPAzChPSt53sO/jOUljFGDlatgEzKSrGqIVgRQKh+iWAj/ZTg2U6zO 5DLIZr+iIhgtsmpw9nLMqUvvHmgSRV0QTFfqy7X3FqT/sB2Wql6U/yGdU1eiI4/DDC4K AUilIjxmOrV+Z8SfGno8ATCWp3I0k00tbBqmSkR1myhsQAT5Oa8gJSXGkLHBSaSwJQrn eU/wf328NC5Z29co8zCXZGxf8EylDwvenrlFbPUoFjoE9vqb56nhaUKu7xb31Qy6zq58 kJRjdLxM0+mY7pzOjmgQ4jciKHA9ADx/D0AQ5/f/QVA6OEnycOZkmXJgU/nQURK3ZrgA 8Asg== MIME-Version: 1.0 X-Received: by 10.58.15.193 with SMTP id z1mr14769405vec.40.1370108347632; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) Received: by 10.220.119.2 with HTTP; Sat, 1 Jun 2013 10:39:07 -0700 (PDT) In-Reply-To: <201306011416.r51EGq41024554@svn.freebsd.org> References: <201306011416.r51EGq41024554@svn.freebsd.org> Date: Sat, 1 Jun 2013 10:39:07 -0700 Message-ID: Subject: Re: svn commit: r251225 - head/contrib/binutils/bfd From: Peter Wemm To: "Pedro F. Giffuni" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmkJCxvbJtJAVw1ME1FJ0WPDMk5KL8nPmQnXtjpDvNqbUpaRy+HR77Qnt/LacM5orquDdb3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 17:39:14 -0000 FYI, this broke i386 builds. Please fix it. /scratch/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/bfdio.c:389:1: error: conflicting types for 'bfd_get_mtime' bfd_get_mtime (bfd *abfd) ^ /scratch/src/gnu/usr.bin/binutils/libbfd/bfd.h:1150:6: note: previous declaration is here long bfd_get_mtime (bfd *abfd); ^ 1 error generated. On Sat, Jun 1, 2013 at 7:16 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jun 1 14:16:51 2013 > New Revision: 251225 > URL: http://svnweb.freebsd.org/changeset/base/251225 > > Log: > BFD: Use time_t instead of long for archive timestamps. > > This basically follows the suggestion in the binutils code and is more > in line with what BSD ar(1) does. > > Obtained from: OpenBSD > MFC after: 2 weeks. > > Modified: > head/contrib/binutils/bfd/archive.c > head/contrib/binutils/bfd/bfd-in2.h > head/contrib/binutils/bfd/bfdio.c > head/contrib/binutils/bfd/coff-rs6000.c > head/contrib/binutils/bfd/ecoff.c > head/contrib/binutils/bfd/libbfd-in.h > head/contrib/binutils/bfd/libbfd.h > > Modified: head/contrib/binutils/bfd/archive.c > ============================================================================== > --- head/contrib/binutils/bfd/archive.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c > /* ar headers are space padded, not null padded! */ > memset (hdr, ' ', sizeof (struct ar_hdr)); > > - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", > - status.st_mtime); > + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", > + (long long)status.st_mtime); > #ifdef HPUX_LARGE_AR_IDS > /* HP has a very "special" way to handle UID/GID's with numeric values > > 99999. */ > @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > if (aloser == hdr->arelt) \ > return -1; > > +#define fooll(arelt, stelt, size) \ > + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ > + if (aloser == hdr->arelt) \ > + return -1; > + > /* Some platforms support special notations for large IDs. */ > #ifdef HPUX_LARGE_AR_IDS > # define foo2(arelt, stelt, size) \ > @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > # define foo2(arelt, stelt, size) foo (arelt, stelt, size) > #endif > > - foo (ar_date, st_mtime, 10); > + fooll (ar_date, st_mtime, 10); > foo2 (ar_uid, st_uid, 10); > foo2 (ar_gid, st_gid, 10); > foo (ar_mode, st_mode, 8); > > Modified: head/contrib/binutils/bfd/bfd-in2.h > ============================================================================== > --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -38,6 +38,7 @@ extern "C" { > > #include "ansidecl.h" > #include "symcat.h" > +#include /* time_t */ > #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) > #ifndef SABER > /* This hack is to avoid a problem with some strict ANSI C preprocessors. > @@ -1141,7 +1142,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se > > > /* Extracted from bfdio.c. */ > -long bfd_get_mtime (bfd *abfd); > +time_t bfd_get_mtime (bfd *abfd); > > file_ptr bfd_get_size (bfd *abfd); > > > Modified: head/contrib/binutils/bfd/bfdio.c > ============================================================================== > --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -377,7 +377,7 @@ FUNCTION > bfd_get_mtime > > SYNOPSIS > - long bfd_get_mtime (bfd *abfd); > + time_t bfd_get_mtime (bfd *abfd); > > DESCRIPTION > Return the file modification time (as read from the file system, or > @@ -385,7 +385,7 @@ DESCRIPTION > > */ > > -long > +time_t > bfd_get_mtime (bfd *abfd) > { > struct stat buf; > > Modified: head/contrib/binutils/bfd/coff-rs6000.c > ============================================================================== > --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1678,6 +1678,7 @@ xcoff_write_armap_old (abfd, elength, ma > static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; > #define FMT20 "%-20lld" > #define FMT12 "%-12d" > +#define FMT12_LL "%-12lld" > #define FMT12_OCTAL "%-12o" > #define FMT4 "%-4d" > #define PRINT20(d, v) \ > @@ -1688,6 +1689,10 @@ static char buff20[XCOFFARMAGBIG_ELEMENT > sprintf (buff20, FMT12, (int)(v)), \ > memcpy ((void *) (d), buff20, 12) > > +#define PRINT12_LL(d, v) \ > + sprintf (buff20, FMT12_LL, (long long)(v)), \ > + memcpy ((void *) (d), buff20, 12) > + > #define PRINT12_OCTAL(d, v) \ > sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ > memcpy ((void *) (d), buff20, 12) > @@ -2152,7 +2157,7 @@ xcoff_write_archive_contents_old (abfd) > } > > sprintf (ahdrp->size, "%ld", (long) s.st_size); > - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); > + sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); > sprintf (ahdrp->uid, "%ld", (long) s.st_uid); > sprintf (ahdrp->gid, "%ld", (long) s.st_gid); > sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); > @@ -2388,7 +2393,7 @@ xcoff_write_archive_contents_big (abfd) > } > > PRINT20 (ahdrp->size, s.st_size); > - PRINT12 (ahdrp->date, s.st_mtime); > + PRINT12_LL (ahdrp->date, s.st_mtime); > PRINT12 (ahdrp->uid, s.st_uid); > PRINT12 (ahdrp->gid, s.st_gid); > PRINT12_OCTAL (ahdrp->mode, s.st_mode); > > Modified: head/contrib/binutils/bfd/ecoff.c > ============================================================================== > --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, > linker just checks the archive name; the GNU linker may check the > date. */ > stat (abfd->filename, &statbuf); > - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); > + sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); > > /* The DECstation uses zeroes for the uid, gid and mode of the > armap. */ > > Modified: head/contrib/binutils/bfd/libbfd-in.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -71,8 +71,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, > > Modified: head/contrib/binutils/bfd/libbfd.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -76,8 +76,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 17:53:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF49F8E0 for ; Sat, 1 Jun 2013 17:53:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm42-vm8.bullet.mail.ne1.yahoo.com (nm42-vm8.bullet.mail.ne1.yahoo.com [98.138.120.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7912495E for ; Sat, 1 Jun 2013 17:53:29 +0000 (UTC) Received: from [98.138.90.53] by nm42.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 Received: from [98.138.84.45] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 Received: from [127.0.0.1] by smtp113.mail.ne1.yahoo.com with NNFMP; 01 Jun 2013 17:48:09 -0000 X-Yahoo-Newman-Id: 300840.24710.bm@smtp113.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 1L6YgvgVM1kfIYYa4ACvefLoLw.R5LPoC6RDaAzFWyEICpl zS.6G1_f73kq8ZciUIQtCeiERsc_C6g4rnU9QHSZEeJzojtPylVWnsiWXN5X xJAhioQu0ZHkZM5Usu_nzJJRF.ab8vEjqGbfE2B21fxuTHmBWis_1KqIMLyC GHYTT4XU0pOFUYFY6Co8NHYOpjRHFfokFRUbop9055Qelq9rZtr4ExaPWdLC N25kXVzk6o1D4gdM.Y6kafnaUhvd_z7ExJCSNnhzrg3KLiiIukw4PgDw0hkq 9KO9bEhq4qaCm9TxeSrt.DlDbw_wZMQrxm18SUL9cep3DqePgauZZ0_3DnSw LAC9qdmsPKbUZRHGW9QoEo3n3smEr_2OHKC4ZrkDQconJIqTi7pua74ObaUv lUKJZF.G83gjjtYWxeYxowcFoWHxc0YoXtG7174lb4t3EAFRQfbr_M8iMlo3 a_lSCHBvhEI6OqWONVkWxnMrQ3LFMu4RzBgI8fSD__KoLHKIXBxDmnPc- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp113.mail.ne1.yahoo.com with SMTP; 01 Jun 2013 10:48:09 -0700 PDT Message-ID: <51AA33D6.2050404@FreeBSD.org> Date: Sat, 01 Jun 2013 12:48:06 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130407 Thunderbird/17.0.5 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r251225 - head/contrib/binutils/bfd References: <201306011416.r51EGq41024554@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 17:53:29 -0000 On 01.06.2013 12:39, Peter Wemm wrote: > FYI, this broke i386 builds. Please fix it. > > /scratch/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/bfdio.c:389:1: > error: conflicting types for 'bfd_get_mtime' > bfd_get_mtime (bfd *abfd) > ^ > /scratch/src/gnu/usr.bin/binutils/libbfd/bfd.h:1150:6: note: previous > declaration is here > long bfd_get_mtime (bfd *abfd); > ^ > 1 error generated. > > Sorry.. will fix now ... Pedro. From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 18:03:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4B15D80; Sat, 1 Jun 2013 18:03:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5A9E99B; Sat, 1 Jun 2013 18:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51I33jY048639; Sat, 1 Jun 2013 18:03:03 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51I326l048629; Sat, 1 Jun 2013 18:03:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306011803.r51I326l048629@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Jun 2013 18:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251227 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 18:03:04 -0000 Author: pfg Date: Sat Jun 1 18:03:01 2013 New Revision: 251227 URL: http://svnweb.freebsd.org/changeset/base/251227 Log: Revert: Use time_t instead of long for archive timestamps. Back out for now: this breaks the i386 build and requires some revision. Modified: head/contrib/binutils/bfd/archive.c head/contrib/binutils/bfd/bfd-in2.h head/contrib/binutils/bfd/bfdio.c head/contrib/binutils/bfd/coff-rs6000.c head/contrib/binutils/bfd/ecoff.c head/contrib/binutils/bfd/libbfd-in.h head/contrib/binutils/bfd/libbfd.h Modified: head/contrib/binutils/bfd/archive.c ============================================================================== --- head/contrib/binutils/bfd/archive.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 18:03:01 2013 (r251227) @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c /* ar headers are space padded, not null padded! */ memset (hdr, ' ', sizeof (struct ar_hdr)); - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", - (long long)status.st_mtime); + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", + status.st_mtime); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1458,11 +1458,6 @@ bfd_generic_stat_arch_elt (bfd *abfd, st if (aloser == hdr->arelt) \ return -1; -#define fooll(arelt, stelt, size) \ - buf->stelt = strtoll (hdr->arelt, &aloser, size); \ - if (aloser == hdr->arelt) \ - return -1; - /* Some platforms support special notations for large IDs. */ #ifdef HPUX_LARGE_AR_IDS # define foo2(arelt, stelt, size) \ @@ -1489,7 +1484,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st # define foo2(arelt, stelt, size) foo (arelt, stelt, size) #endif - fooll (ar_date, st_mtime, 10); + foo (ar_date, st_mtime, 10); foo2 (ar_uid, st_uid, 10); foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); Modified: head/contrib/binutils/bfd/bfd-in2.h ============================================================================== --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 18:03:01 2013 (r251227) @@ -38,7 +38,6 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" -#include /* time_t */ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) #ifndef SABER /* This hack is to avoid a problem with some strict ANSI C preprocessors. @@ -1142,7 +1141,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se /* Extracted from bfdio.c. */ -time_t bfd_get_mtime (bfd *abfd); +long bfd_get_mtime (bfd *abfd); file_ptr bfd_get_size (bfd *abfd); Modified: head/contrib/binutils/bfd/bfdio.c ============================================================================== --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 18:03:01 2013 (r251227) @@ -377,7 +377,7 @@ FUNCTION bfd_get_mtime SYNOPSIS - time_t bfd_get_mtime (bfd *abfd); + long bfd_get_mtime (bfd *abfd); DESCRIPTION Return the file modification time (as read from the file system, or @@ -385,7 +385,7 @@ DESCRIPTION */ -time_t +long bfd_get_mtime (bfd *abfd) { struct stat buf; Modified: head/contrib/binutils/bfd/coff-rs6000.c ============================================================================== --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 18:03:01 2013 (r251227) @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); - s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) { struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); - s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); @@ -1678,7 +1678,6 @@ xcoff_write_armap_old (abfd, elength, ma static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define FMT20 "%-20lld" #define FMT12 "%-12d" -#define FMT12_LL "%-12lld" #define FMT12_OCTAL "%-12o" #define FMT4 "%-4d" #define PRINT20(d, v) \ @@ -1689,10 +1688,6 @@ static char buff20[XCOFFARMAGBIG_ELEMENT sprintf (buff20, FMT12, (int)(v)), \ memcpy ((void *) (d), buff20, 12) -#define PRINT12_LL(d, v) \ - sprintf (buff20, FMT12_LL, (long long)(v)), \ - memcpy ((void *) (d), buff20, 12) - #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ memcpy ((void *) (d), buff20, 12) @@ -2157,7 +2152,7 @@ xcoff_write_archive_contents_old (abfd) } sprintf (ahdrp->size, "%ld", (long) s.st_size); - sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); + sprintf (ahdrp->date, "%ld", (long) s.st_mtime); sprintf (ahdrp->uid, "%ld", (long) s.st_uid); sprintf (ahdrp->gid, "%ld", (long) s.st_gid); sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); @@ -2393,7 +2388,7 @@ xcoff_write_archive_contents_big (abfd) } PRINT20 (ahdrp->size, s.st_size); - PRINT12_LL (ahdrp->date, s.st_mtime); + PRINT12 (ahdrp->date, s.st_mtime); PRINT12 (ahdrp->uid, s.st_uid); PRINT12 (ahdrp->gid, s.st_gid); PRINT12_OCTAL (ahdrp->mode, s.st_mode); Modified: head/contrib/binutils/bfd/ecoff.c ============================================================================== --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 18:03:01 2013 (r251227) @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, linker just checks the archive name; the GNU linker may check the date. */ stat (abfd->filename, &statbuf); - sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); + sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); /* The DECstation uses zeroes for the uid, gid and mode of the armap. */ Modified: head/contrib/binutils/bfd/libbfd-in.h ============================================================================== --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 18:03:01 2013 (r251227) @@ -71,7 +71,8 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - time_t armap_timestamp; /* Timestamp value written into armap. + /* when more compilers are standard C, this can be a time_t */ + long armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, Modified: head/contrib/binutils/bfd/libbfd.h ============================================================================== --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 15:02:15 2013 (r251226) +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 18:03:01 2013 (r251227) @@ -76,7 +76,8 @@ struct artdata { symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ bfd_size_type extended_names_size; /* Size of extended names */ - time_t armap_timestamp; /* Timestamp value written into armap. + /* when more compilers are standard C, this can be a time_t */ + long armap_timestamp; /* Timestamp value written into armap. This is used for BSD archives to check that the timestamp is recent enough for the BSD linker to not complain, From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 20:32:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08F71CE3; Sat, 1 Jun 2013 20:32:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F01B4E32; Sat, 1 Jun 2013 20:32:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51KWY8q000709; Sat, 1 Jun 2013 20:32:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51KWYY9000708; Sat, 1 Jun 2013 20:32:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201306012032.r51KWYY9000708@svn.freebsd.org> From: Alan Cox Date: Sat, 1 Jun 2013 20:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251229 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 20:32:35 -0000 Author: alc Date: Sat Jun 1 20:32:34 2013 New Revision: 251229 URL: http://svnweb.freebsd.org/changeset/base/251229 Log: Now that access to the page's "act_count" field is synchronized by the page lock instead of the object lock, there is no reason for vm_page_activate() to assert that the object is locked for either read or write access. (The "VPO_UNMANAGED" flag never changes after page allocation.) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jun 1 19:07:03 2013 (r251228) +++ head/sys/vm/vm_page.c Sat Jun 1 20:32:34 2013 (r251229) @@ -1837,7 +1837,6 @@ vm_page_activate(vm_page_t m) int queue; vm_page_lock_assert(m, MA_OWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); if ((queue = m->queue) != PQ_ACTIVE) { if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { if (m->act_count < ACT_INIT) From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 21:02:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0763E28B; Sat, 1 Jun 2013 21:02:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDC6DEE8; Sat, 1 Jun 2013 21:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51L2QCg010981; Sat, 1 Jun 2013 21:02:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51L2QOq010979; Sat, 1 Jun 2013 21:02:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306012102.r51L2QOq010979@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Jun 2013 21:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251230 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 21:02:27 -0000 Author: ed Date: Sat Jun 1 21:02:26 2013 New Revision: 251230 URL: http://svnweb.freebsd.org/changeset/base/251230 Log: Move into sys/sys/. This will allow us to use C11 atomics in kernelspace, although it will need to be included as . Added: head/sys/sys/stdatomic.h - copied unchanged from r251216, head/include/stdatomic.h Deleted: head/include/stdatomic.h Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Jun 1 20:32:34 2013 (r251229) +++ head/include/Makefile Sat Jun 1 21:02:26 2013 (r251230) @@ -19,7 +19,7 @@ INCS= a.out.h ar.h assert.h bitstring.h printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \ res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \ - signal.h spawn.h stab.h stdalign.h stdatomic.h stdbool.h stddef.h \ + signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \ stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ @@ -33,8 +33,8 @@ MHDRS= float.h floatingpoint.h stdarg.h PHDRS= sched.h _semaphore.h -LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ - ucontext.h +LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ + syslog.h ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ netipsec ${_netipx} netnatm \ Copied: head/sys/sys/stdatomic.h (from r251216, head/include/stdatomic.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/stdatomic.h Sat Jun 1 21:02:26 2013 (r251230, copy of r251216, head/include/stdatomic.h) @@ -0,0 +1,325 @@ +/*- + * Copyright (c) 2011 Ed Schouten + * David Chisnall + * 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 _STDATOMIC_H_ +#define _STDATOMIC_H_ + +#include +#include + +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) +#define __CLANG_ATOMICS +#elif __GNUC_PREREQ__(4, 7) +#define __GNUC_ATOMICS +#elif !defined(__GNUC__) +#error "stdatomic.h does not support your compiler" +#endif + +#if !defined(__CLANG_ATOMICS) +#define _Atomic(T) struct { volatile T __val; } +#endif + +/* + * 7.17.2 Initialization. + */ + +#if defined(__CLANG_ATOMICS) +#define ATOMIC_VAR_INIT(value) (value) +#define atomic_init(obj, value) __c11_atomic_init(obj, value) +#else +#define ATOMIC_VAR_INIT(value) { .__val = (value) } +#define atomic_init(obj, value) ((void)((obj)->__val = (value))) +#endif + +/* + * Clang and recent GCC both provide predefined macros for the memory + * orderings. If we are using a compiler that doesn't define them, use the + * clang values - these will be ignored in the fallback path. + */ + +#ifndef __ATOMIC_RELAXED +#define __ATOMIC_RELAXED 0 +#endif +#ifndef __ATOMIC_CONSUME +#define __ATOMIC_CONSUME 1 +#endif +#ifndef __ATOMIC_ACQUIRE +#define __ATOMIC_ACQUIRE 2 +#endif +#ifndef __ATOMIC_RELEASE +#define __ATOMIC_RELEASE 3 +#endif +#ifndef __ATOMIC_ACQ_REL +#define __ATOMIC_ACQ_REL 4 +#endif +#ifndef __ATOMIC_SEQ_CST +#define __ATOMIC_SEQ_CST 5 +#endif + +/* + * 7.17.3 Order and consistency. + * + * The memory_order_* constants that denote the barrier behaviour of the + * atomic operations. + */ + +enum memory_order { + memory_order_relaxed = __ATOMIC_RELAXED, + memory_order_consume = __ATOMIC_CONSUME, + memory_order_acquire = __ATOMIC_ACQUIRE, + memory_order_release = __ATOMIC_RELEASE, + memory_order_acq_rel = __ATOMIC_ACQ_REL, + memory_order_seq_cst = __ATOMIC_SEQ_CST +}; + +/* + * 7.17.4 Fences. + */ + +#ifdef __CLANG_ATOMICS +#define atomic_thread_fence(order) __c11_atomic_thread_fence(order) +#define atomic_signal_fence(order) __c11_atomic_signal_fence(order) +#elif defined(__GNUC_ATOMICS) +#define atomic_thread_fence(order) __atomic_thread_fence(order) +#define atomic_signal_fence(order) __atomic_signal_fence(order) +#else +#define atomic_thread_fence(order) ((void)(order), __sync_synchronize()) +#define atomic_signal_fence(order) __extension__ ({ \ + (void)(order); \ + __asm volatile ("" ::: "memory"); \ + (void)0; \ +}) +#endif + +/* + * 7.17.5 Lock-free property. + */ + +#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) +#define atomic_is_lock_free(obj) \ + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) +#else +#define atomic_is_lock_free(obj) \ + ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) +#endif + +/* + * 7.17.6 Atomic integer types. + */ + +typedef _Atomic(_Bool) atomic_bool; +typedef _Atomic(char) atomic_char; +typedef _Atomic(signed char) atomic_schar; +typedef _Atomic(unsigned char) atomic_uchar; +typedef _Atomic(short) atomic_short; +typedef _Atomic(unsigned short) atomic_ushort; +typedef _Atomic(int) atomic_int; +typedef _Atomic(unsigned int) atomic_uint; +typedef _Atomic(long) atomic_long; +typedef _Atomic(unsigned long) atomic_ulong; +typedef _Atomic(long long) atomic_llong; +typedef _Atomic(unsigned long long) atomic_ullong; +typedef _Atomic(__char16_t) atomic_char16_t; +typedef _Atomic(__char32_t) atomic_char32_t; +typedef _Atomic(__wchar_t) atomic_wchar_t; +typedef _Atomic(__int_least8_t) atomic_int_least8_t; +typedef _Atomic(__uint_least8_t) atomic_uint_least8_t; +typedef _Atomic(__int_least16_t) atomic_int_least16_t; +typedef _Atomic(__uint_least16_t) atomic_uint_least16_t; +typedef _Atomic(__int_least32_t) atomic_int_least32_t; +typedef _Atomic(__uint_least32_t) atomic_uint_least32_t; +typedef _Atomic(__int_least64_t) atomic_int_least64_t; +typedef _Atomic(__uint_least64_t) atomic_uint_least64_t; +typedef _Atomic(__int_fast8_t) atomic_int_fast8_t; +typedef _Atomic(__uint_fast8_t) atomic_uint_fast8_t; +typedef _Atomic(__int_fast16_t) atomic_int_fast16_t; +typedef _Atomic(__uint_fast16_t) atomic_uint_fast16_t; +typedef _Atomic(__int_fast32_t) atomic_int_fast32_t; +typedef _Atomic(__uint_fast32_t) atomic_uint_fast32_t; +typedef _Atomic(__int_fast64_t) atomic_int_fast64_t; +typedef _Atomic(__uint_fast64_t) atomic_uint_fast64_t; +typedef _Atomic(__intptr_t) atomic_intptr_t; +typedef _Atomic(__uintptr_t) atomic_uintptr_t; +typedef _Atomic(__size_t) atomic_size_t; +typedef _Atomic(__ptrdiff_t) atomic_ptrdiff_t; +typedef _Atomic(__intmax_t) atomic_intmax_t; +typedef _Atomic(__uintmax_t) atomic_uintmax_t; + +/* + * 7.17.7 Operations on atomic types. + */ + +/* + * Compiler-specific operations. + */ + +#if defined(__CLANG_ATOMICS) +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) \ + __c11_atomic_compare_exchange_strong(object, expected, desired, \ + success, failure) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + __c11_atomic_compare_exchange_weak(object, expected, desired, \ + success, failure) +#define atomic_exchange_explicit(object, desired, order) \ + __c11_atomic_exchange(object, desired, order) +#define atomic_fetch_add_explicit(object, operand, order) \ + __c11_atomic_fetch_add(object, operand, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __c11_atomic_fetch_and(object, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __c11_atomic_fetch_or(object, operand, order) +#define atomic_fetch_sub_explicit(object, operand, order) \ + __c11_atomic_fetch_sub(object, operand, order) +#define atomic_fetch_xor_explicit(object, operand, order) \ + __c11_atomic_fetch_xor(object, operand, order) +#define atomic_load_explicit(object, order) \ + __c11_atomic_load(object, order) +#define atomic_store_explicit(object, desired, order) \ + __c11_atomic_store(object, desired, order) +#elif defined(__GNUC_ATOMICS) +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) \ + __atomic_compare_exchange_n(&(object)->__val, expected, \ + desired, 0, success, failure) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + __atomic_compare_exchange_n(&(object)->__val, expected, \ + desired, 1, success, failure) +#define atomic_exchange_explicit(object, desired, order) \ + __atomic_exchange_n(&(object)->__val, desired, order) +#define atomic_fetch_add_explicit(object, operand, order) \ + __atomic_fetch_add(&(object)->__val, operand, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __atomic_fetch_and(&(object)->__val, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __atomic_fetch_or(&(object)->__val, operand, order) +#define atomic_fetch_sub_explicit(object, operand, order) \ + __atomic_fetch_sub(&(object)->__val, operand, order) +#define atomic_fetch_xor_explicit(object, operand, order) \ + __atomic_fetch_xor(&(object)->__val, operand, order) +#define atomic_load_explicit(object, order) \ + __atomic_load_n(&(object)->__val, order) +#define atomic_store_explicit(object, desired, order) \ + __atomic_store_n(&(object)->__val, desired, order) +#else +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) __extension__ ({ \ + __typeof__(expected) __ep = (expected); \ + __typeof__(*__ep) __e = *__ep; \ + (void)(success); (void)(failure); \ + (*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e; \ +}) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) +#if __has_builtin(__sync_swap) +/* Clang provides a full-barrier atomic exchange - use it if available. */ +#define atomic_exchange_explicit(object, desired, order) \ + ((void)(order), __sync_swap(&(object)->__val, desired)) +#else +/* + * __sync_lock_test_and_set() is only an acquire barrier in theory (although in + * practice it is usually a full barrier) so we need an explicit barrier before + * it. + */ +#define atomic_exchange_explicit(object, desired, order) \ +__extension__ ({ \ + __typeof__(object) __o = (object); \ + __typeof__(desired) __d = (desired); \ + (void)(order); \ + __sync_synchronize(); \ + __sync_lock_test_and_set(&(__o)->__val, __d); \ +}) +#endif +#define atomic_fetch_add_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_add(&(object)->__val, operand)) +#define atomic_fetch_and_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) +#define atomic_fetch_or_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) +#define atomic_fetch_sub_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_sub(&(object)->__val, operand)) +#define atomic_fetch_xor_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) +#define atomic_load_explicit(object, order) \ + ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) +#define atomic_store_explicit(object, desired, order) \ + ((void)atomic_exchange_explicit(object, desired, order)) +#endif + +/* + * Convenience functions. + */ + +#define atomic_compare_exchange_strong(object, expected, desired) \ + atomic_compare_exchange_strong_explicit(object, expected, \ + desired, memory_order_seq_cst, memory_order_seq_cst) +#define atomic_compare_exchange_weak(object, expected, desired) \ + atomic_compare_exchange_weak_explicit(object, expected, \ + desired, memory_order_seq_cst, memory_order_seq_cst) +#define atomic_exchange(object, desired) \ + atomic_exchange_explicit(object, desired, memory_order_seq_cst) +#define atomic_fetch_add(object, operand) \ + atomic_fetch_add_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_and(object, operand) \ + atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_or(object, operand) \ + atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_sub(object, operand) \ + atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_xor(object, operand) \ + atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst) +#define atomic_load(object) \ + atomic_load_explicit(object, memory_order_seq_cst) +#define atomic_store(object, desired) \ + atomic_store_explicit(object, desired, memory_order_seq_cst) + +/* + * 7.17.8 Atomic flag type and operations. + */ + +typedef atomic_bool atomic_flag; + +#define ATOMIC_FLAG_INIT ATOMIC_VAR_INIT(0) + +#define atomic_flag_clear_explicit(object, order) \ + atomic_store_explicit(object, 0, order) +#define atomic_flag_test_and_set_explicit(object, order) \ + atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) + +#define atomic_flag_clear(object) \ + atomic_flag_clear_explicit(object, memory_order_seq_cst) +#define atomic_flag_test_and_set(object) \ + atomic_flag_test_and_set_explicit(object, memory_order_seq_cst) + +#endif /* !_STDATOMIC_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 21:29:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7354F43E; Sat, 1 Jun 2013 21:29:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64E35FA1; Sat, 1 Jun 2013 21:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51LTsHh020551; Sat, 1 Jun 2013 21:29:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51LTsN7020550; Sat, 1 Jun 2013 21:29:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012129.r51LTsN7020550@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 21:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251232 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 21:29:54 -0000 Author: dteske Date: Sat Jun 1 21:29:53 2013 New Revision: 251232 URL: http://svnweb.freebsd.org/changeset/base/251232 Log: Fix a regression in the packages module introduced by recent r251190. I somehow neglected this module in merging that API change. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 21:28:43 2013 (r251231) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 21:29:53 2013 (r251232) @@ -297,13 +297,13 @@ f_package_menu_categories() $category_list " # End-Quote - local size dialog_menu - size=$( eval f_dialog_menu_with_help_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + local height width rows dialog_menu + eval f_dialog_menu_with_help_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ @@ -312,7 +312,8 @@ f_package_menu_categories() --default-item \"\$defaultitem\" \ --ok-label \"$msg_select\" \ --cancel-label \"$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -455,17 +456,15 @@ f_package_menu_select() "$page" "$npages" )" local hline="$hline_arrows_tab_punc_enter" - local size isize dialog_menu item - size=$( eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) - isize=$( f_dialog_infobox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$msg_processing_selection" ) + local mheight mwidth mrows + f_dialog_menu${SHOW_DESC:+_with_help}_size mheight mwidth mrows \ + \"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \"\$hline\" $menu_list + local iheight iwidth + f_dialog_infobox_size iheight iwidth \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" \ + "$msg_processing_selection" + local dialog_menu item dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ @@ -475,11 +474,13 @@ f_package_menu_select() --cancel-label \"$msg_back\" \ ${SHOW_DESC:+--item-help} \ --default-item \"\$defaultitem\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $mheight $mwidth $mrows \ $menu_list \ --and-widget \ ${USE_XDIALOG:+--no-buttons} \ - --infobox \"\$msg_processing_selection\" $isize \ + --infobox \"\$msg_processing_selection\" \ + $iheight $iwidth \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? @@ -504,7 +505,7 @@ f_package_menu_select() # f_package_menu_deselect() { - local package="$1" prompt menu_list size dialog_menu + local package="$1" prompt menu_list dialog_menu prompt=$( printf "$msg_what_would_you_like_to_do_with" "$package" ) local hline="$hline_alnum_arrows_punc_tab_enter" menu_list=" @@ -512,19 +513,23 @@ f_package_menu_deselect() 'R $msg_reinstall' '$msg_reinstall_desc' 'U $msg_uninstall' '$msg_uninstall_desc' " # End-Quote - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"$msg_select\" \ --cancel-label \"$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) @@ -542,7 +547,7 @@ f_package_menu_deselect() # f_package_review() { - local prompt size dialog_menu package varpkg mark menu_list= + local prompt dialog_menu package varpkg mark menu_list= prompt=$( printf "$msg_reviewing_selected_packages" \ "$_All_nselected" ) local hline="$hline_alnum_arrows_punc_tab_enter" @@ -562,19 +567,23 @@ f_package_review() return $FAILURE # They might have selected this by accident fi menu_list=$( echo "$menu_list" | sort ) - size=$( eval f_dialog_menu_size \ - \"\$DIALOG_TITLE\" \ - \"\$DIALOG_BACKTITLE\" \ - \"\$prompt\" \ - \"\$hline\" \ - $menu_list ) + + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_proceed\" \ --cancel-label \"\$msg_cancel\" \ - --menu \"\$prompt\" $size \ + --menu \"\$prompt\" \ + $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 22:12:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82DAEF63; Sat, 1 Jun 2013 22:12:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73DE8E7; Sat, 1 Jun 2013 22:12:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51MCsRo037049; Sat, 1 Jun 2013 22:12:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51MCsMm037048; Sat, 1 Jun 2013 22:12:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012212.r51MCsMm037048@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 22:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251233 - head/usr.sbin/bsdconfig/timezone X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 22:12:54 -0000 Author: dteske Date: Sat Jun 1 22:12:53 2013 New Revision: 251233 URL: http://svnweb.freebsd.org/changeset/base/251233 Log: Fix a typo introduced by r251190. Modified: head/usr.sbin/bsdconfig/timezone/timezone Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Sat Jun 1 21:29:53 2013 (r251232) +++ head/usr.sbin/bsdconfig/timezone/timezone Sat Jun 1 22:12:53 2013 (r251233) @@ -89,7 +89,7 @@ dialog_menu_main() \"\$title\" \ \"\$btitle\" \ \"\$prompt\" \ - \"\$\" \ + \"\" \ $continent_menu_list local dialog_menu From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 23:58:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF5AF5DA; Sat, 1 Jun 2013 23:58:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFAE25E6; Sat, 1 Jun 2013 23:58:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51Nwnoo006528; Sat, 1 Jun 2013 23:58:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51NwiFI006489; Sat, 1 Jun 2013 23:58:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306012358.r51NwiFI006489@svn.freebsd.org> From: Devin Teske Date: Sat, 1 Jun 2013 23:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251236 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share security share share/media share/packages startup startup/share timezone usermgmt usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Jun 2013 23:58:49 -0000 Author: dteske Date: Sat Jun 1 23:58:44 2013 New Revision: 251236 URL: http://svnweb.freebsd.org/changeset/base/251236 Log: Improve portion of the dialog(1) API in dialog.subr responsible for retrieving stored data (for the --menu, --calendar, --timebox, --checklist, and --radiolist widgets). When we (Ron McDowell and I) developed the first version of bsdconfig, it used temporary files to store responses from dialog(1). That hasn't been true for some very long time, so the need to always store the return status of dialog(1) and then call some function to clean-up is long-deprecated. The function that used to do the clean-up was f_dialog_menutag(). We really don't need f_dialog_menutag() for its originally designed purpose, as all dialog invocations (even when in a sub-shell) do not use temporary files anymore. However, we do need to keep f_dialog_menutag() around because it still fills the need of being able to abstract the procedure for fetching stored data provided by functions that display the aforementioned widgets. In re-designing f_dialog_menutag(), four important changes are made: 1. Rename f_dialog_menutag() to f_dialog_menutag_fetch() 2. Introduce the new first-argument of $var_to_set to reduce number of forks 3. Create a corresponding f_dialog_menutag_store() to abstract the storage 4. Offload the sanitization to a new function, f_dialog_data_sanitize() NOTE: That last one is important. Not all functions need to store their data for later fetching, meanwhile every invocation of dialog should be sanitized (as we learned early-on in the i18n-effort -- underlying libraries will spit warnings to stderr for bad values of $LANG and since dialog outputs its responses to stderr, we need to sanitize every response of these warnings). These changes greatly improve readbaility and also improve performance by reducing unnecessary forking. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/bsdconfig Sat Jun 1 23:58:44 2013 (r251236) @@ -187,8 +187,8 @@ dialog_menu_main() \"\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --clear \ --title \"\$title\" \ --backtitle \"\$btitle\" \ @@ -205,10 +205,11 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -298,7 +299,7 @@ fi while :; do dialog_menu_main retval=$? - mtag=$( f_dialog_menutag ) + f_dialog_menutag_fetch mtag f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/console Sat Jun 1 23:58:44 2013 (r251236) @@ -70,8 +70,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,8 +84,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -115,11 +116,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/font Sat Jun 1 23:58:44 2013 (r251236) @@ -95,8 +95,8 @@ dialog_menu_main() swiss-8x8) defaultitem="e $msg_swiss";; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -109,7 +109,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -139,11 +139,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_none") # Use hardware default font Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/keymap Sat Jun 1 23:58:44 2013 (r251236) @@ -193,8 +193,8 @@ dialog_menu_main() ) && defaultitem=" $defaultitem" fi - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -207,7 +207,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -237,11 +237,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag # # Reverse the users choice into the variable name Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/repeat Sat Jun 1 23:58:44 2013 (r251236) @@ -75,8 +75,8 @@ dialog_menu_main() [Nn][Oo]|'') defaultitem="$msg_default";; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -89,7 +89,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -119,11 +119,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "$msg_slow") # Slow keyboard repeat rate Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/saver Sat Jun 1 23:58:44 2013 (r251236) @@ -94,8 +94,8 @@ dialog_menu_main() [Nn][Oo]|'') defaultitem="d $msg_none" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -108,7 +108,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -138,11 +138,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_blank") # Simply blank the screen Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/screenmap Sat Jun 1 23:58:44 2013 (r251236) @@ -79,8 +79,8 @@ dialog_menu_main() koi8-u2cp866u) defaultitem="6 $msg_koi8_u_to_ibm866u" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -93,7 +93,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -123,11 +123,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_none") # No screenmap, don't touch font Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/console/ttys Sat Jun 1 23:58:44 2013 (r251236) @@ -83,8 +83,8 @@ dialog_menu_main() \"\$hline\" \ $TTY_MENU_LIST - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -96,7 +96,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -182,11 +182,9 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag - [ $retval -eq 0 ] || f_die [ "$mtag" = "1 $msg_none" ] && break consterm=$( eval f_dialog_menutag2item \"\$mtag\" $TTY_MENU_LIST ) Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/mouse Sat Jun 1 23:58:44 2013 (r251236) @@ -69,8 +69,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -83,8 +83,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -114,11 +115,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/port Sat Jun 1 23:58:44 2013 (r251236) @@ -79,8 +79,8 @@ dialog_menu_main() /dev/mse0) defaultitem="6 $msg_busmouse" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -93,7 +93,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -123,11 +123,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_ps2") # PS/2 style mouse (/dev/psm0) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/mouse/type Sat Jun 1 23:58:44 2013 (r251236) @@ -87,8 +87,8 @@ dialog_menu_main() thinkingmouse) defaultitem="A $msg_thinkingmouse" ;; esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -101,7 +101,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -131,11 +131,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "1 $msg_auto") # Bus mouse, PS/2 style mouse or PnP serial mouse Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/devices Sat Jun 1 23:58:44 2013 (r251236) @@ -73,13 +73,10 @@ f_mustberoot_init # defaultitem="" while :; do - f_dialog_menu_netdev "$defaultitem" - retval=$? - interface=$( f_dialog_menutag ) + f_dialog_menu_netdev "$defaultitem" || break + f_dialog_menutag_fetch interface defaultitem="$interface" - [ $retval -eq 0 ] || break - # # dialog_menu_netdev adds an asterisk (*) to the right of the # device name if the interface is active. Remove the asterisk Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/networking Sat Jun 1 23:58:44 2013 (r251236) @@ -67,8 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -81,8 +81,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -112,11 +113,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in X) # Exit Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -151,8 +151,8 @@ f_dialog_menu_netdev() \"\$prompt\" \ \"\$hline\" \ $interfaces - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -165,7 +165,7 @@ f_dialog_menu_netdev() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -224,8 +224,8 @@ f_dialog_menu_netdev_edit() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -240,10 +240,8 @@ f_dialog_menu_netdev_edit() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" + f_dialog_data_sanitize tag if [ $retval -eq 2 ]; then # The Help button was pressed Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -205,8 +205,8 @@ f_dialog_menu_media_options() local hline="$hline_arrows_tab_enter" - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -216,11 +216,10 @@ f_dialog_menu_media_options() $supported_media \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize tag + if [ $retval -eq $SUCCESS ]; then - local tag="$( f_dialog_menutag )" options=$( eval f_dialog_menutag2item \"\$tag\" \ $supported_media ) [ "$options" = "$opt_none" ] && options= Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -435,8 +435,8 @@ f_dialog_menu_nameservers() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -448,10 +448,8 @@ f_dialog_menu_nameservers() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" ns="" + f_dialog_data_sanitize tag # Return if "Cancel" was chosen (-1) or ESC was pressed (255) if [ $retval -ne $SUCCESS ]; then @@ -467,6 +465,7 @@ f_dialog_menu_nameservers() f_dialog_input_nameserver ;; *) + local n ns n=$( eval f_dialog_menutag2index \"\$tag\" $menu_list ) ns=$( eval f_dialog_menutag2item \"\$tag\" $menu_list ) f_dialog_input_nameserver $(( $n - 2 )) "$ns" Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Sat Jun 1 23:58:44 2013 (r251236) @@ -81,8 +81,8 @@ dialog_menu_main() defaultitem="$msg_disabled" esac - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -98,7 +98,7 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -130,7 +130,7 @@ f_mustberoot_init while :; do dialog_menu_main retval=$? - mtag=$( f_dialog_menutag ) + f_dialog_menutag_fetch mtag if [ $retval -eq 2 ]; then # The Help button was pressed Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/security/security Sat Jun 1 23:58:44 2013 (r251236) @@ -105,8 +105,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -119,10 +119,11 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu" + [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -153,11 +154,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in "X <<< $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/device.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -619,6 +619,7 @@ f_device_menu() case $- in *e*) errexit=1; esac set +e + local mtag while :; do mtag=$( eval $DIALOG \ --title \"\$title\" \ @@ -648,8 +649,7 @@ f_device_menu() if [ $retval -eq 0 ]; then # Clean up the output of [X]dialog(1) and return it - setvar DIALOG_MENU_$$ "$mtag" - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag echo "$mtag" >&2 fi Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -107,6 +107,45 @@ DIALOG_TIMEBOX_HEIGHT=6 ############################################################ GENERIC FUNCTIONS +# f_dialog_data_sanitize $var_to_edit ... +# +# When using dialog(1) or Xdialog(1) sometimes unintended warnings or errors +# are generated from underlying libraries. For example, if $LANG is set to an +# invalid or unknown locale, the warnings from the Xdialog(1) libraries will +# clutter the output. This function helps by providing a centralied function +# that removes spurious warnings from the dialog(1) (or Xdialog(1)) response. +# +# Simply pass the name of one or more variables that need to be sanitized. +# After execution, the variables will hold their newly-sanitized data. +# +f_dialog_data_sanitize() +{ + if [ "$#" -eq 0 ]; then + f_dprintf "%s: called with zero arguments" \ + f_dialog_response_sanitize + return $FAILURE + fi + + local __var_to_edit + for __var_to_edit in $*; do + # Skip warnings and trim leading/trailing whitespace + setvar $__var_to_edit "$( f_getvar $__var_to_edit | awk ' + BEGIN { data = 0 } + { + if ( ! data ) + { + if ( $0 ~ /^$/ ) next + if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next + data = 1 + } + print + } + ' )" + done +} + +############################################################ TITLE FUNCTIONS + # f_dialog_title [$new_title] # # Set the title of future dialog(1) ($DIALOG_TITLE) or backtitle of Xdialog(1) @@ -1622,29 +1661,41 @@ f_dialog_input() ############################################################ MENU FUNCTIONS -# f_dialog_menutag +# f_dialog_menutag_store [-s] $text +# +# Store some text from a dialog(1) menu to be retrieved later by +# f_dialog_menutag_fetch(). If the first argument is `-s', the text is +# sanitized before being stored. +# +f_dialog_menutag_store() +{ + local sanitize= + [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s + local text="$1" + + # Sanitize the menutag before storing it if desired + [ "$sanitize" ] && f_dialog_data_sanitize text + + setvar DIALOG_MENU_$$ "$text" +} + +# f_dialog_menutag_fetch [$var_to_set] # # Obtain the menutag chosen by the user from the most recently displayed -# dialog(1) menu and clean up any temporary files/variables. +# dialog(1) menu (previously stored with f_dialog_menutag_store() above). If +# $var_to_set is NULL or missing, output is printed to stdout (which is less +# recommended due to performance degradation; in a loop for example). # -f_dialog_menutag() +f_dialog_menutag_fetch() { - # Skip warnings - eval echo \"\$DIALOG_MENU_$$\" | awk ' - BEGIN { found = 0 } - { - if ( found ) # ... just spew - { - print - next - } - if ( $0 ~ /^$/ ) next - if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next - found = 1 - print - } - ' + local __var_to_set="$1" __cp + + debug= f_getvar DIALOG_MENU_$$ "${__var_to_set:-__cp}" # get the data setvar DIALOG_MENU_$$ "" # scrub memory in case data was sensitive + + # Return the data on standard-out if desired + [ "$__var_to_set" ] || echo "$__cp" + return $SUCCESS } Modified: head/usr.sbin/bsdconfig/share/media/any.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/any.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/any.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -94,10 +94,9 @@ f_media_get_type() \"\$hline\" \ $menu_list - local dialog_menu - + local mtag while :; do - dialog_menu=$( eval $DIALOG \ + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -112,10 +111,7 @@ f_media_get_type() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - - local mtag - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -237,8 +237,8 @@ f_dialog_menu_media_ftp() \"\$hline\" \ $menu_list - local dialog_menu retval mtag value - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -248,16 +248,13 @@ f_dialog_menu_media_ftp() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) - retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || return $FAILURE + ) || return $FAILURE + f_dialog_data_sanitize mtag case "$mtag" in URL) setvar $VAR_FTP_PATH "other" ;; *) + local value value=$( eval f_dialog_menutag2item \"\$mtag\" $menu_list ) setvar $VAR_FTP_PATH "ftp://$value" esac Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/options.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -208,9 +208,8 @@ f_media_options_menu() \"\$hline\" \ $menu_list - local dialog_menu - - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -227,11 +226,8 @@ f_media_options_menu() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - defaultitem="$dialog_menu" - - local mtag - mtag=$( f_dialog_menutag ) + f_dialog_data_sanitize mtag + defaultitem="$mtag" f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -1399,8 +1399,7 @@ f_device_dialog_tcp() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$cp" - cp=$( f_dialog_menutag ) + f_dialog_data_sanitize cp f_dprintf "retval=%u mtag=[%s]" $retval "$cp" if [ $retval -eq 2 ]; then Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -105,8 +105,8 @@ f_become_root_via_sudo() \"\$hline\" \ $menu_list - local dialog_menu mtag retval - dialog_menu=$( eval $DIALOG \ + local mtag + mtag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -116,12 +116,8 @@ f_become_root_via_sudo() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) - retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + ) || f_die + f_dialog_data_sanitize mtag case "$mtag" in X) # Cancel/Exit Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 22:53:11 2013 (r251235) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sat Jun 1 23:58:44 2013 (r251236) @@ -272,8 +272,8 @@ f_package_calculate_rundeps() # Dislay the menu of package categories, complete with package counts for each # category, accents, and other miscellany. If $defaultitem is non-NULL and # matches one of the existing menu-items, it will be pre-highlighted in the -# menu dialog (HINT: Use f_dialog_menutag() to populate a local variable that -# is passed as $defaultitem to highlight the user's last selection by default). +# menu dialog (HINT: Use f_dialog_menutag_fetch() to populate a local variable +# that is passed as $defaultitem to highlight the user's last selection). # f_package_menu_categories() { @@ -297,14 +297,15 @@ f_package_menu_categories() $category_list " # End-Quote - local height width rows dialog_menu + local height width rows eval f_dialog_menu_with_help_size height width rows \ \"\$DIALOG_TITLE\" \ \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \ \"\$hline\" \ $menu_list - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -318,7 +319,7 @@ f_package_menu_categories() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -360,7 +361,7 @@ f_package_index_get_page() # # On success, if the user doesn't press ESC or choose Cancel, the environment # variable $DIALOG_MENUITEM_$$ will hold the item associated with the chosen -# tag (accessible through f_dialog_menutag()). +# tag (accessible through f_dialog_menutag_fetch()). # f_package_menu_select() { @@ -464,8 +465,9 @@ f_package_menu_select() f_dialog_infobox_size iheight iwidth \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" \ "$msg_processing_selection" - local dialog_menu item - dialog_menu=$( eval $DIALOG \ + + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -484,11 +486,13 @@ f_package_menu_select() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" if [ $retval -eq $SUCCESS ]; then + local item item=$( eval f_dialog_menutag2item${SHOW_DESC:+_with_help} \ - \"\$dialog_menu\" $menu_list ) + \"\$menu_choice\" $menu_list ) setvar DIALOG_MENUITEM_$$ "$item" fi @@ -501,11 +505,11 @@ f_package_menu_select() # with regard to "deselecting" an already installed package. Choices include # uninstall, re-install, or cancel (leave $package marked as installed). # Returns success if the user does not press ESC or choose Cnacel. Use the -# f_dialog_menutag() function upon success to retrieve the user's choice. +# f_dialog_menutag_fetch() function upon success to retrieve the user's choice. # f_package_menu_deselect() { - local package="$1" prompt menu_list dialog_menu + local package="$1" prompt menu_list prompt=$( printf "$msg_what_would_you_like_to_do_with" "$package" ) local hline="$hline_alnum_arrows_punc_tab_enter" menu_list=" @@ -521,8 +525,8 @@ f_package_menu_deselect() \"\$prompt\" \ \"\$hline\" \ $menu_list - - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -534,7 +538,7 @@ f_package_menu_deselect() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***