From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 02:42:01 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08FF6106564A; Sun, 6 Jun 2010 02:42:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B0CB68FC17; Sun, 6 Jun 2010 02:42:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o562XWgE088694; Sat, 5 Jun 2010 20:33:33 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 05 Jun 2010 20:33:48 -0600 (MDT) Message-Id: <20100605.203348.651115405925906974.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 02:42:01 -0000 In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> Marcel Moolenaar writes: : : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: : : > Author: nwhitehorn : > Date: Sat Jun 5 20:41:22 2010 : > New Revision: 208850 : > URL: http://svn.freebsd.org/changeset/base/208850 : > : > Log: : > BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should be an int, : > not a long. : : This probably isn't right. How would you distinguish between a 32-bit : maximum of and unlimited if both can have the value 0xFFFFFFFF. : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to 64-bit : and thus prevents this ambiguity. But this define is used for busdma's number of segments. It isn't used for an address at all... from the busdma man page for bus_dma_tag_create: nsegments Number of discontinuities (scatter/gather segments) allowed in a DMA mapped region. If there is no restriction, BUS_SPACE_UNRESTRICTED may be speci- fied. so an argument consistent with the definition of nsegments is what is needed. The man page doesn't specify a type for nsegments, but sys/bus_dma.h defines it as: int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, bus_dma_filter_t *filtfunc, void *filtfuncarg, bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat); so it is more proper to have it be an int than a long. I got tripped up on this stupid name too when I was adding it for MIPS. Any why it is in a MD file instead of an MI file is beyond me. I think it should be defined in sys/bus_dma.h, but maybe I'm just nuts... Warner From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 02:45:27 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 901871065676; Sun, 6 Jun 2010 02:45:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAA18FC15; Sun, 6 Jun 2010 02:45:27 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L3K00K00NNQ9500@smtpauth3.wiscmail.wisc.edu>; Sat, 05 Jun 2010 21:45:26 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-76-208-69-183.dsl.mdsnwi.sbcglobal.net [76.208.69.183]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L3K00EQFNNMLY30@smtpauth3.wiscmail.wisc.edu>; Sat, 05 Jun 2010 21:45:23 -0500 (CDT) Date: Sat, 05 Jun 2010 21:45:21 -0500 From: Nathan Whitehorn In-reply-to: <20100605.203348.651115405925906974.imp@bsdimp.com> To: "M. Warner Losh" Message-id: <4C0B0BC1.1010701@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.69.183 X-Spam-PmxInfo: Server=avs-11, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.6.23316, SenderIP=76.208.69.183 References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100407 Thunderbird/3.0.4 Cc: svn-src-projects@FreeBSD.org, xcllnt@mac.com, src-committers@FreeBSD.org Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 02:45:27 -0000 On 06/05/10 21:33, M. Warner Losh wrote: > In message:<184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> > Marcel Moolenaar writes: > : > : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: > : > :> Author: nwhitehorn > :> Date: Sat Jun 5 20:41:22 2010 > :> New Revision: 208850 > :> URL: http://svn.freebsd.org/changeset/base/208850 > :> > :> Log: > :> BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should be an int, > :> not a long. > : > : This probably isn't right. How would you distinguish between a 32-bit > : maximum of and unlimited if both can have the value 0xFFFFFFFF. > : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to 64-bit > : and thus prevents this ambiguity. > > But this define is used for busdma's number of segments. It isn't > used for an address at all... > > from the busdma man page for bus_dma_tag_create: > nsegments Number of discontinuities (scatter/gather segments) > allowed in a DMA mapped region. If there is no > restriction, BUS_SPACE_UNRESTRICTED may be speci- > fied. > > so an argument consistent with the definition of nsegments is what is > needed. The man page doesn't specify a type for nsegments, but > sys/bus_dma.h defines it as: > > int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, > bus_size_t boundary, bus_addr_t lowaddr, > bus_addr_t highaddr, bus_dma_filter_t *filtfunc, > void *filtfuncarg, bus_size_t maxsize, int nsegments, > bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, > void *lockfuncarg, bus_dma_tag_t *dmat); > > so it is more proper to have it be an int than a long. > > I got tripped up on this stupid name too when I was adding it for > MIPS. Any why it is in a MD file instead of an MI file is beyond me. > I think it should be defined in sys/bus_dma.h, but maybe I'm just nuts... > Exactly. I had erroneously switched it to a long because of the same logic, and then things stopped compiling. A lot of these defines would make more sense in an MI header (BUS_SPACE_MAXADDR_XXBIT and the like). -Nathan From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 03:50:10 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C33B106566C; Sun, 6 Jun 2010 03:50:10 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 0CE098FC1B; Sun, 6 Jun 2010 03:50:09 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3K00EF4QNBRC10@asmtp025.mac.com>; Sat, 05 Jun 2010 20:50:01 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006050215 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-05_02:2010-02-06, 2010-06-05, 2010-06-05 signatures=0 From: Marcel Moolenaar In-reply-to: <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> Date: Sat, 05 Jun 2010 20:49:59 -0700 Message-id: References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 03:50:10 -0000 On Jun 5, 2010, at 8:38 PM, Scott Long wrote: > On Jun 5, 2010, at 8:33 PM, M. Warner Losh wrote: >> In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> >> Marcel Moolenaar writes: >> : >> : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: >> : >> : > Author: nwhitehorn >> : > Date: Sat Jun 5 20:41:22 2010 >> : > New Revision: 208850 >> : > URL: http://svn.freebsd.org/changeset/base/208850 >> : > >> : > Log: >> : > BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should be an int, >> : > not a long. >> : >> : This probably isn't right. How would you distinguish between a 32-bit >> : maximum of and unlimited if both can have the value 0xFFFFFFFF. >> : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to 64-bit >> : and thus prevents this ambiguity. >> >> But this define is used for busdma's number of segments. It isn't >> used for an address at all... >> >> from the busdma man page for bus_dma_tag_create: >> nsegments Number of discontinuities (scatter/gather segments) >> allowed in a DMA mapped region. If there is no >> restriction, BUS_SPACE_UNRESTRICTED may be speci- >> fied. >> >> so an argument consistent with the definition of nsegments is what is >> needed. The man page doesn't specify a type for nsegments, but >> sys/bus_dma.h defines it as: >> >> int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, >> bus_size_t boundary, bus_addr_t lowaddr, >> bus_addr_t highaddr, bus_dma_filter_t *filtfunc, >> void *filtfuncarg, bus_size_t maxsize, int nsegments, >> bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, >> void *lockfuncarg, bus_dma_tag_t *dmat); >> >> so it is more proper to have it be an int than a long. >> >> I got tripped up on this stupid name too when I was adding it for >> MIPS. Any why it is in a MD file instead of an MI file is beyond me. >> I think it should be defined in sys/bus_dma.h, but maybe I'm just nuts... >> > > No, you're not nuts. I've had a grand unification of MI/MD parts of busdma on my mind for years, and probably at least 2 or 3 aborted attempts lying around in old defunct trees. Any unification is going to risk API/ABI changes, so I ultimately don't want to do it simply for cleanliness sake. Scott, I've started an unification on the Altix branch myself because I need to add I/O MMU support for ia64 in order to get FreeBSD booting on the SGI Altix (there's no physical memory under 4GB so bounce buffering is impossible). If I need to work on busdma, I'd rather unify the whole lot so that other platforms can use I/O MMU when it's present. Can you send me whatever you have or have done before so that I can leverage. BTW: my current approach is to take the amd64 implementation as a base, and move platform specific code back into MD code. Also: if there's interest among more people, we should probably create a special branch for it and work together. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 03:54:01 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 787F2106566C; Sun, 6 Jun 2010 03:54:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 196ED8FC15; Sun, 6 Jun 2010 03:54:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o563qL1k089244; Sat, 5 Jun 2010 21:52:21 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 05 Jun 2010 21:52:27 -0600 (MDT) Message-Id: <20100605.215227.4959786928943391.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> References: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-projects@FreeBSD.org, xcllnt@mac.com, nwhitehorn@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 03:54:01 -0000 In message: <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> Scott Long writes: : On Jun 5, 2010, at 8:33 PM, M. Warner Losh wrote: : > In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> : > Marcel Moolenaar writes: : > : : > : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: : > : : > : > Author: nwhitehorn : > : > Date: Sat Jun 5 20:41:22 2010 : > : > New Revision: 208850 : > : > URL: http://svn.freebsd.org/changeset/base/208850 : > : > : > : > Log: : > : > BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should be an int, : > : > not a long. : > : : > : This probably isn't right. How would you distinguish between a 32-bit : > : maximum of and unlimited if both can have the value 0xFFFFFFFF. : > : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to 64-bit : > : and thus prevents this ambiguity. : > : > But this define is used for busdma's number of segments. It isn't : > used for an address at all... : > : > from the busdma man page for bus_dma_tag_create: : > nsegments Number of discontinuities (scatter/gather segments) : > allowed in a DMA mapped region. If there is no : > restriction, BUS_SPACE_UNRESTRICTED may be speci- : > fied. : > : > so an argument consistent with the definition of nsegments is what is : > needed. The man page doesn't specify a type for nsegments, but : > sys/bus_dma.h defines it as: : > : > int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, : > bus_size_t boundary, bus_addr_t lowaddr, : > bus_addr_t highaddr, bus_dma_filter_t *filtfunc, : > void *filtfuncarg, bus_size_t maxsize, int nsegments, : > bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, : > void *lockfuncarg, bus_dma_tag_t *dmat); : > : > so it is more proper to have it be an int than a long. : > : > I got tripped up on this stupid name too when I was adding it for : > MIPS. Any why it is in a MD file instead of an MI file is beyond me. : > I think it should be defined in sys/bus_dma.h, but maybe I'm just nuts... : > : : No, you're not nuts. I've had a grand unification of MI/MD parts of : busdma on my mind for years, and probably at least 2 or 3 aborted : attempts lying around in old defunct trees. Any unification is : going to risk API/ABI changes, so I ultimately don't want to do it : simply for cleanliness sake. At this point, all the architectures have the same BUS_SPACE_UNRESTRICTED definition, so it would be safe to move into sys/bus_dma.h. And even if one were to have an unsigned long, it would get truncated to an int anyway... Warner From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 04:05:13 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2E8F106566B for ; Sun, 6 Jun 2010 04:05:13 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 88AB88FC0A for ; Sun, 6 Jun 2010 04:05:13 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.3/8.14.3) with ESMTP id o563cUgT034821; Sat, 5 Jun 2010 21:38:30 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <20100605.203348.651115405925906974.imp@bsdimp.com> Date: Sat, 5 Jun 2010 21:38:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> To: "M. Warner Losh" X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-projects@FreeBSD.org, xcllnt@mac.com, nwhitehorn@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 04:05:14 -0000 On Jun 5, 2010, at 8:33 PM, M. Warner Losh wrote: > In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> > Marcel Moolenaar writes: > :=20 > : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: > :=20 > : > Author: nwhitehorn > : > Date: Sat Jun 5 20:41:22 2010 > : > New Revision: 208850 > : > URL: http://svn.freebsd.org/changeset/base/208850 > : >=20 > : > Log: > : > BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should be = an int, > : > not a long. > :=20 > : This probably isn't right. How would you distinguish between a = 32-bit > : maximum of and unlimited if both can have the value 0xFFFFFFFF. > : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to = 64-bit > : and thus prevents this ambiguity. >=20 > But this define is used for busdma's number of segments. It isn't > used for an address at all... >=20 > from the busdma man page for bus_dma_tag_create: > nsegments Number of discontinuities (scatter/gather = segments) > allowed in a DMA mapped region. If there is = no > restriction, BUS_SPACE_UNRESTRICTED may be = speci- > fied. >=20 > so an argument consistent with the definition of nsegments is what is > needed. The man page doesn't specify a type for nsegments, but > sys/bus_dma.h defines it as: >=20 > int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, > bus_size_t boundary, bus_addr_t lowaddr, > bus_addr_t highaddr, bus_dma_filter_t *filtfunc, > void *filtfuncarg, bus_size_t maxsize, int = nsegments, > bus_size_t maxsegsz, int flags, bus_dma_lock_t = *lockfunc, > void *lockfuncarg, bus_dma_tag_t *dmat); >=20 > so it is more proper to have it be an int than a long. >=20 > I got tripped up on this stupid name too when I was adding it for > MIPS. Any why it is in a MD file instead of an MI file is beyond me. > I think it should be defined in sys/bus_dma.h, but maybe I'm just = nuts... >=20 No, you're not nuts. I've had a grand unification of MI/MD parts of = busdma on my mind for years, and probably at least 2 or 3 aborted = attempts lying around in old defunct trees. Any unification is going to = risk API/ABI changes, so I ultimately don't want to do it simply for = cleanliness sake. =20 Scott From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 08:06:17 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC3C3106566B; Sun, 6 Jun 2010 08:06:17 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 768A48FC22; Sun, 6 Jun 2010 08:06:17 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o56868bk003445; Sun, 6 Jun 2010 02:06:08 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: Date: Sun, 6 Jun 2010 02:06:08 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 08:06:17 -0000 On Jun 5, 2010, at 9:49 PM, Marcel Moolenaar wrote: >=20 > On Jun 5, 2010, at 8:38 PM, Scott Long wrote: >=20 >> On Jun 5, 2010, at 8:33 PM, M. Warner Losh wrote: >>> In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> >>> Marcel Moolenaar writes: >>> :=20 >>> : On Jun 5, 2010, at 1:41 PM, Nathan Whitehorn wrote: >>> :=20 >>> : > Author: nwhitehorn >>> : > Date: Sat Jun 5 20:41:22 2010 >>> : > New Revision: 208850 >>> : > URL: http://svn.freebsd.org/changeset/base/208850 >>> : >=20 >>> : > Log: >>> : > BUS_SPACE_UNRESTRICTED is a flag, not an address, so it should = be an int, >>> : > not a long. >>> :=20 >>> : This probably isn't right. How would you distinguish between a = 32-bit >>> : maximum of and unlimited if both can have the value 0xFFFFFFFF. >>> : Making BUS_SPACE_UNRESTRICTED a long prevents zero-extension to = 64-bit >>> : and thus prevents this ambiguity. >>>=20 >>> But this define is used for busdma's number of segments. It isn't >>> used for an address at all... >>>=20 >>> from the busdma man page for bus_dma_tag_create: >>> nsegments Number of discontinuities (scatter/gather = segments) >>> allowed in a DMA mapped region. If there is = no >>> restriction, BUS_SPACE_UNRESTRICTED may be = speci- >>> fied. >>>=20 >>> so an argument consistent with the definition of nsegments is what = is >>> needed. The man page doesn't specify a type for nsegments, but >>> sys/bus_dma.h defines it as: >>>=20 >>> int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, >>> bus_size_t boundary, bus_addr_t lowaddr, >>> bus_addr_t highaddr, bus_dma_filter_t *filtfunc, >>> void *filtfuncarg, bus_size_t maxsize, int = nsegments, >>> bus_size_t maxsegsz, int flags, bus_dma_lock_t = *lockfunc, >>> void *lockfuncarg, bus_dma_tag_t *dmat); >>>=20 >>> so it is more proper to have it be an int than a long. >>>=20 >>> I got tripped up on this stupid name too when I was adding it for >>> MIPS. Any why it is in a MD file instead of an MI file is beyond = me. >>> I think it should be defined in sys/bus_dma.h, but maybe I'm just = nuts... >>>=20 >>=20 >> No, you're not nuts. I've had a grand unification of MI/MD parts of = busdma on my mind for years, and probably at least 2 or 3 aborted = attempts lying around in old defunct trees. Any unification is going to = risk API/ABI changes, so I ultimately don't want to do it simply for = cleanliness sake. =20 >=20 > Scott, >=20 > I've started an unification on the Altix branch myself because I > need to add I/O MMU support for ia64 in order to get FreeBSD booting > on the SGI Altix (there's no physical memory under 4GB so bounce > buffering is impossible). If I need to work on busdma, I'd rather > unify the whole lot so that other platforms can use I/O MMU when > it's present. >=20 > Can you send me whatever you have or have done before so that I > can leverage. >=20 > BTW: my current approach is to take the amd64 implementation as a > base, and move platform specific code back into MD code. >=20 > Also: if there's interest among more people, we should probably > create a special branch for it and work together. >=20 I struggle with answering the question of whether to just reorg the = interface definitions but leave the interface alone, or whether to = rewrite the interface definitions in the context of having a new DMA = api. There are a lot of things that I like about busdma, and a lot of things = that I dislike. Some things are simply too hard, clunky, and = inflexible, like allocating static memory for DMA. I like the two-stage = load paradigm for i/o bufs, but it's really not appropriate for anything = besides I/O, and I wonder if it'll start to be a performance liability = as i/o transaction speed reaches network transaction levels. I really = don't like the inconsistency and confusion in the naming of certain = functions and constants, something clearly brought out in this thread. = I don't like that simply allocating a tag is a daunting task for sorting = out and supplying 14 argument. There's probably a few other things that = I'd really like to change, too. So the question is where to start and = how far to go. Does it make sense to preserve the existing interface = and layer a new meta-interface on top of it? Or does it make sense to = just change everything in-place and make a clean break from the past? = Or like I said before, is a "new" interface really not that important, = with the important thing being to clean up the glaring problems in the = existing interface. =20 On the specific topic of BUS_SPACE_UNRESTRICTED, that's a definition = that seems to have been "borrowed" from the bus_space API. Maybe at one = time there was a desire to marry bus_space (bus.h) and bus_dma together = in some fashion, but I don't see that having any practical value now. = bus_dma.h and bus.h are separate interfaces and shouldn't be sharing = definitions, as far as I'm concerned. If there are any disagreements on = this, I'm happy to hear them. Scott From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 12:53:42 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 679161065676; Sun, 6 Jun 2010 12:53:42 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 462BC8FC1F; Sun, 6 Jun 2010 12:53:42 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3L00JC8FSVUB80@asmtp024.mac.com>; Sun, 06 Jun 2010 05:53:19 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006060063 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-06_01:2010-02-06, 2010-06-06, 2010-06-05 signatures=0 From: Marcel Moolenaar In-reply-to: Date: Sun, 06 Jun 2010 05:53:18 -0700 Message-id: References: <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com> <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org, "M. Warner Losh" Subject: Re: busdma [was: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 12:53:42 -0000 [about unifying busdma implementations] On Jun 6, 2010, at 1:06 AM, Scott Long wrote: >> Can you send me whatever you have or have done before so that I >> can leverage. >> > > I struggle with answering the question of whether to just reorg the interface definitions but leave the interface alone, or whether to rewrite the interface definitions in the context of having a new DMA api. *snip* I understand. All I can say is that when 90-95% of busdma is MI code and you only have a few MD functions, interface redesigns are a lot easier to manage and much less time-consuming to implement and test. I have an interest in busdma/mi, simply because it allows me add a feature to ia64 in a way that benefits all platforms and as such makes the work useful even if I have to abandon ia64 altogether. If busdma/mi ends your struggle and starts your work on busdma/ng, then I'm fine with that too. Then busdma/mi was still useful, just in a different way. Maybe busdma/ng cannot really happen without having busdma/mi first... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 14:31:42 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB27D106566C; Sun, 6 Jun 2010 14:31:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 967A48FC12; Sun, 6 Jun 2010 14:31:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56EVg1D068102; Sun, 6 Jun 2010 14:31:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56EVgaL068073; Sun, 6 Jun 2010 14:31:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006061431.o56EVgaL068073@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 6 Jun 2010 14:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208872 - in projects/ppc64: lib/libpmc sys/arm/arm sys/dev/ata sys/dev/ata/chipsets sys/dev/bge sys/dev/hwpmc sys/dev/isp sys/mips/mips sys/netinet sys/powerpc/aim sys/powerpc/booke sy... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 14:31:42 -0000 Author: nwhitehorn Date: Sun Jun 6 14:31:41 2010 New Revision: 208872 URL: http://svn.freebsd.org/changeset/base/208872 Log: IFC once more @ 208871 Modified: projects/ppc64/lib/libpmc/pmclog.c projects/ppc64/sys/arm/arm/pmap.c projects/ppc64/sys/dev/ata/ata-all.h projects/ppc64/sys/dev/ata/ata-lowlevel.c projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c projects/ppc64/sys/dev/bge/if_bge.c projects/ppc64/sys/dev/bge/if_bgereg.h projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c projects/ppc64/sys/dev/isp/isp.c projects/ppc64/sys/mips/mips/pmap.c projects/ppc64/sys/netinet/sctp_auth.c projects/ppc64/sys/netinet/sctp_bsd_addr.c projects/ppc64/sys/netinet/sctp_indata.c projects/ppc64/sys/netinet/sctp_input.c projects/ppc64/sys/netinet/sctp_output.c projects/ppc64/sys/netinet/sctp_pcb.c projects/ppc64/sys/netinet/sctp_pcb.h projects/ppc64/sys/netinet/sctp_usrreq.c projects/ppc64/sys/netinet/sctputil.c projects/ppc64/sys/powerpc/aim/mmu_oea.c projects/ppc64/sys/powerpc/booke/pmap.c projects/ppc64/sys/powerpc/powermac/macgpio.c projects/ppc64/sys/powerpc/powermac/uninorth.c projects/ppc64/sys/sparc64/sparc64/pmap.c projects/ppc64/sys/sys/pmc.h projects/ppc64/tools/tools/netrate/tcpp/README projects/ppc64/tools/tools/netrate/tcpp/tcpp.c projects/ppc64/tools/tools/netrate/tcpp/tcpp.h projects/ppc64/tools/tools/netrate/tcpp/tcpp_client.c projects/ppc64/tools/tools/netrate/tcpp/tcpp_server.c projects/ppc64/usr.bin/bc/scan.l projects/ppc64/usr.bin/dc/bcode.c projects/ppc64/usr.bin/dc/dc.c projects/ppc64/usr.sbin/pmcstat/pmcpl_calltree.c projects/ppc64/usr.sbin/pmcstat/pmcstat.c projects/ppc64/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: projects/ppc64/ (props changed) projects/ppc64/cddl/contrib/opensolaris/ (props changed) projects/ppc64/contrib/ee/ (props changed) projects/ppc64/contrib/expat/ (props changed) projects/ppc64/contrib/file/ (props changed) projects/ppc64/contrib/gdb/ (props changed) projects/ppc64/contrib/gnu-sort/ (props changed) projects/ppc64/contrib/groff/ (props changed) projects/ppc64/contrib/less/ (props changed) projects/ppc64/contrib/libpcap/ (props changed) projects/ppc64/contrib/ncurses/ (props changed) projects/ppc64/contrib/one-true-awk/ (props changed) projects/ppc64/contrib/openbsm/ (props changed) projects/ppc64/contrib/openpam/ (props changed) projects/ppc64/contrib/pf/ (props changed) projects/ppc64/contrib/tcpdump/ (props changed) projects/ppc64/contrib/tcsh/ (props changed) projects/ppc64/contrib/tzcode/stdtime/ (props changed) projects/ppc64/contrib/tzcode/zic/ (props changed) projects/ppc64/contrib/tzdata/ (props changed) projects/ppc64/contrib/wpa/ (props changed) projects/ppc64/lib/libutil/ (props changed) projects/ppc64/lib/libz/ (props changed) projects/ppc64/sbin/ (props changed) projects/ppc64/sbin/ipfw/ (props changed) projects/ppc64/sys/ (props changed) projects/ppc64/sys/amd64/include/xen/ (props changed) projects/ppc64/sys/cddl/contrib/opensolaris/ (props changed) projects/ppc64/sys/contrib/dev/acpica/ (props changed) projects/ppc64/sys/contrib/x86emu/ (props changed) projects/ppc64/sys/dev/xen/xenpci/ (props changed) projects/ppc64/usr.bin/csup/ (props changed) projects/ppc64/usr.bin/procstat/ (props changed) Modified: projects/ppc64/lib/libpmc/pmclog.c ============================================================================== --- projects/ppc64/lib/libpmc/pmclog.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/lib/libpmc/pmclog.c Sun Jun 6 14:31:41 2010 (r208872) @@ -549,8 +549,10 @@ pmclog_open(int fd) /* allocate space for a work area */ if (ps->ps_fd != PMCLOG_FD_NONE) { - if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL) + if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL) { + free(ps); return NULL; + } } return ps; Modified: projects/ppc64/sys/arm/arm/pmap.c ============================================================================== --- projects/ppc64/sys/arm/arm/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/arm/arm/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3412,7 +3412,8 @@ do_l2b_alloc: if (prot & VM_PROT_WRITE) { npte |= L2_S_PROT_W; - if (m != NULL) + if (m != NULL && + (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) vm_page_flag_set(m, PG_WRITEABLE); } npte |= pte_l2_s_cache_mode; Modified: projects/ppc64/sys/dev/ata/ata-all.h ============================================================================== --- projects/ppc64/sys/dev/ata/ata-all.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/ata-all.h Sun Jun 6 14:31:41 2010 (r208872) @@ -564,6 +564,7 @@ struct ata_channel { #define ATA_CHECKS_CABLE 0x20 #define ATA_NO_ATAPI_DMA 0x40 #define ATA_SATA 0x80 +#define ATA_DMA_BEFORE_CMD 0x100 int pm_level; /* power management level */ int devices; /* what is present */ Modified: projects/ppc64/sys/dev/ata/ata-lowlevel.c ============================================================================== --- projects/ppc64/sys/dev/ata/ata-lowlevel.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/ata-lowlevel.c Sun Jun 6 14:31:41 2010 (r208872) @@ -141,6 +141,14 @@ ata_begin_transaction(struct ata_request goto begin_finished; } + /* start DMA engine if necessary */ + if ((ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { + device_printf(request->parent, "error starting DMA\n"); + request->result = EIO; + goto begin_finished; + } + /* issue command */ if (ch->hw.command(request)) { device_printf(request->parent, "error issuing %s command\n", @@ -150,7 +158,8 @@ ata_begin_transaction(struct ata_request } /* start DMA engine */ - if (ch->dma.start && ch->dma.start(request)) { + if (!(ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; Modified: projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c Sun Jun 6 14:31:41 2010 (r208872) @@ -241,6 +241,16 @@ ata_serverworks_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0); ATA_OUTL(ctlr->r_res2, ch_offset + 0x80, ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000); + + /* + * Some controllers have a bug where they will send the command + * to the drive before seeing a DMA start, and then can begin + * receiving data before the DMA start arrives. The controller + * will then become confused and either corrupt the data or crash. + * Remedy this by starting DMA before sending the drive command. + */ + + ch->flags |= ATA_DMA_BEFORE_CMD; } /* chip does not reliably do 64K DMA transfers */ Modified: projects/ppc64/sys/dev/bge/if_bge.c ============================================================================== --- projects/ppc64/sys/dev/bge/if_bge.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/bge/if_bge.c Sun Jun 6 14:31:41 2010 (r208872) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -922,6 +924,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -979,6 +982,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -991,18 +999,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1014,12 +1026,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1027,7 +1033,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1036,8 +1042,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1079,14 +1085,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3273,6 +3279,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3336,24 +3369,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: projects/ppc64/sys/dev/bge/if_bgereg.h ============================================================================== --- projects/ppc64/sys/dev/bge/if_bgereg.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/bge/if_bgereg.h Sun Jun 6 14:31:41 2010 (r208872) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { Modified: projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/hwpmc/hwpmc_mod.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1248,7 +1248,7 @@ pmc_process_csw_in(struct thread *td) continue; /* increment PMC runcount */ - atomic_add_rel_32(&pm->pm_runcount, 1); + atomic_add_rel_int(&pm->pm_runcount, 1); /* configure the HWPMC we are going to use. */ pcd = pmc_ri_to_classdep(md, ri, &adjri); @@ -1387,7 +1387,7 @@ pmc_process_csw_out(struct thread *td) pcd->pcd_stop_pmc(cpu, adjri); /* reduce this PMC's runcount */ - atomic_subtract_rel_32(&pm->pm_runcount, 1); + atomic_subtract_rel_int(&pm->pm_runcount, 1); /* * If this PMC is associated with this process, @@ -3252,9 +3252,6 @@ pmc_syscall_handler(struct thread *td, v } } - if (error) - break; - /* * Look for valid values for 'pm_flags' */ @@ -4045,7 +4042,7 @@ pmc_process_interrupt(int cpu, struct pm ("[pmc,%d] pm=%p runcount %d", __LINE__, (void *) pm, pm->pm_runcount)); - atomic_add_rel_32(&pm->pm_runcount, 1); /* hold onto PMC */ + atomic_add_rel_int(&pm->pm_runcount, 1); /* hold onto PMC */ ps->ps_pmc = pm; if ((td = curthread) && td->td_proc) ps->ps_pid = td->td_proc->p_pid; @@ -4246,7 +4243,7 @@ pmc_process_samples(int cpu) entrydone: ps->ps_nsamples = 0; /* mark entry as free */ - atomic_subtract_rel_32(&pm->pm_runcount, 1); + atomic_subtract_rel_int(&pm->pm_runcount, 1); /* increment read pointer, modulo sample size */ if (++ps == psb->ps_fence) @@ -4418,7 +4415,7 @@ pmc_process_exit(void *arg __unused, str mtx_pool_unlock_spin(pmc_mtxpool, pm); } - atomic_subtract_rel_32(&pm->pm_runcount,1); + atomic_subtract_rel_int(&pm->pm_runcount,1); KASSERT((int) pm->pm_runcount >= 0, ("[pmc,%d] runcount is %d", __LINE__, ri)); Modified: projects/ppc64/sys/dev/isp/isp.c ============================================================================== --- projects/ppc64/sys/dev/isp/isp.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/dev/isp/isp.c Sun Jun 6 14:31:41 2010 (r208872) @@ -4184,7 +4184,7 @@ int isp_start(XS_T *xs) { ispsoftc_t *isp; - uint32_t handle; + uint32_t handle, cdblen; uint8_t local[QENTRY_LEN]; ispreq_t *reqp; void *cdbp, *qep; @@ -4369,11 +4369,17 @@ isp_start(XS_T *xs) tptr = &reqp->req_time; + /* + * NB: we do not support long CDBs + */ + cdblen = XS_CDBLEN(xs); + if (IS_SCSI(isp)) { reqp->req_target = target | (XS_CHANNEL(xs) << 7); reqp->req_lun_trn = XS_LUN(xs); - reqp->req_cdblen = XS_CDBLEN(xs); + cdblen = MIN(cdblen, sizeof (reqp->req_cdb)); cdbp = reqp->req_cdb; + reqp->req_cdblen = cdblen; } else if (IS_24XX(isp)) { ispreqt7_t *t7 = (ispreqt7_t *)local; fcportdb_t *lp; @@ -4388,25 +4394,29 @@ isp_start(XS_T *xs) t7->req_lun[0] |= 0x40; } t7->req_lun[1] = XS_LUN(xs); - cdbp = t7->req_cdb; tptr = &t7->req_time; + cdbp = t7->req_cdb; + cdblen = MIN(cdblen, sizeof (t7->req_cdb)); } else if (ISP_CAP_2KLOGIN(isp)) { ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = target; t2e->req_scclun = XS_LUN(xs); cdbp = t2e->req_cdb; + cdblen = MIN(cdblen, sizeof (t2e->req_cdb)); } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_scclun = XS_LUN(xs); cdbp = t2->req_cdb; + cdblen = MIN(cdblen, sizeof (t2->req_cdb)); } else { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_lun_trn = XS_LUN(xs); cdbp = t2->req_cdb; + cdblen = MIN(cdblen, sizeof (t2->req_cdb)); } - ISP_MEMCPY(cdbp, XS_CDBP(xs), XS_CDBLEN(xs)); + ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); *tptr = XS_TIME(xs) / 1000; if (*tptr == 0 && XS_TIME(xs)) { Modified: projects/ppc64/sys/mips/mips/pmap.c ============================================================================== --- projects/ppc64/sys/mips/mips/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/mips/mips/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3072,26 +3072,20 @@ page_is_managed(vm_offset_t pa) static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot) { - int rw = 0; + int rw; if (!(prot & VM_PROT_WRITE)) rw = PTE_ROPAGE; - else { - if (va >= VM_MIN_KERNEL_ADDRESS) { - /* - * Don't bother to trap on kernel writes, just - * record page as dirty. - */ - rw = PTE_RWPAGE; - vm_page_dirty(m); - } else if ((m->md.pv_flags & PV_TABLE_MOD) || - m->dirty == VM_PAGE_BITS_ALL) + else if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->md.pv_flags & PV_TABLE_MOD) != 0) rw = PTE_RWPAGE; else rw = PTE_CWPAGE; vm_page_flag_set(m, PG_WRITEABLE); - } - return rw; + } else + /* Needn't emulate a modified bit for unmanaged pages. */ + rw = PTE_RWPAGE; + return (rw); } /* Modified: projects/ppc64/sys/netinet/sctp_auth.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_auth.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_auth.c Sun Jun 6 14:31:41 2010 (r208872) @@ -895,9 +895,9 @@ static inline int sctp_get_hmac_block_len(uint16_t hmac_algo) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: #ifdef HAVE_SHA224 - case SCTP_AUTH_HMAC_ID_SHA224: + case SCTP_AUTH_HMAC_ID_SHA224: #endif return (64); #ifdef HAVE_SHA2 @@ -918,7 +918,7 @@ static void sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Init(&ctx->sha1); break; #ifdef HAVE_SHA224 @@ -948,7 +948,7 @@ sctp_hmac_update(uint16_t hmac_algo, sct uint8_t * text, uint32_t textlen) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Update(&ctx->sha1, text, textlen); break; #ifdef HAVE_SHA224 @@ -978,7 +978,7 @@ sctp_hmac_final(uint16_t hmac_algo, sctp uint8_t * digest) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Final(digest, &ctx->sha1); break; #ifdef HAVE_SHA224 Modified: projects/ppc64/sys/netinet/sctp_bsd_addr.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_bsd_addr.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_bsd_addr.c Sun Jun 6 14:31:41 2010 (r208872) @@ -140,7 +140,6 @@ sctp_startup_iterator(void) SCTP_KTRHEAD_NAME); } - #ifdef INET6 void Modified: projects/ppc64/sys/netinet/sctp_indata.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_indata.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_indata.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3849,7 +3849,8 @@ sctp_window_probe_recovery(struct sctp_t sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ tp1->sent = SCTP_DATAGRAM_RESEND; - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, tp1->whoTo->flight_size, @@ -4262,7 +4263,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } @@ -5263,7 +5264,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } Modified: projects/ppc64/sys/netinet/sctp_input.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_input.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_input.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3067,7 +3067,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4861,6 +4861,9 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } *offset = length; return (NULL); } @@ -5408,13 +5411,16 @@ sctp_process_ecn_marked_b(struct sctp_tc } #ifdef INVARIANTS -static void -sctp_validate_no_locks(struct sctp_inpcb *inp) +#ifdef __GNUC__ +__attribute__((noinline)) +#endif + void + sctp_validate_no_locks(struct sctp_inpcb *inp) { - struct sctp_tcb *stcb; + struct sctp_tcb *lstcb; - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&stcb->tcb_mtx)) { + LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { + if (mtx_owned(&lstcb->tcb_mtx)) { panic("Own lock on stcb at return from input"); } } Modified: projects/ppc64/sys/netinet/sctp_output.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_output.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_output.c Sun Jun 6 14:31:41 2010 (r208872) @@ -3053,32 +3053,32 @@ sctp_source_address_selection(struct sct * it out * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V4 - *------------------------------------------ + * ------------------------------------------ * source * dest * result * ----------------------------------------- * Private * Global * NAT * ----------------------------------------- * Private * Private * No problem * ----------------------------------------- - * Global * Private * Huh, How will this work? + * Global * Private * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V6 - *------------------------------------------ + *------------------------------------------ * source * dest * result * ----------------------------------------- * Linklocal * Global * * ----------------------------------------- * Linklocal * Linklocal * No problem * ----------------------------------------- - * Global * Linklocal * Huh, How will this work? + * Global * Linklocal * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - * + * * And then we add to that what happens if there are multiple addresses * assigned to an interface. Remember the ifa on a ifn is a linked * list of addresses. So one interface can have more than one IP @@ -3091,13 +3091,13 @@ sctp_source_address_selection(struct sct * Decisions: * * - count the number of addresses on the interface. - * - if it is one, no problem except case . - * For we will assume a NAT out there. + * - if it is one, no problem except case . + * For we will assume a NAT out there. * - if there are more than one, then we need to worry about scope P * or G. We should prefer G -> G and P -> P if possible. * Then as a secondary fall back to mixed types G->P being a last * ditch one. - * - The above all works for bound all, but bound specific we need to + * - The above all works for bound all, but bound specific we need to * use the same concept but instead only consider the bound * addresses. If the bound set is NOT assigned to the interface then * we must use rotation amongst the bound addresses.. @@ -8913,6 +8913,9 @@ sctp_chunk_retransmission(struct sctp_in if ((chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) || (chk->rec.chunk_id.id == SCTP_STREAM_RESET) || (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)) { + if (chk->sent != SCTP_DATAGRAM_RESEND) { + continue; + } if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { if (chk != asoc->str_reset) { /* @@ -8973,7 +8976,7 @@ sctp_chunk_retransmission(struct sctp_in /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; - /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */ + sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); if (fwd_tsn == 0) { return (0); } else { @@ -13427,6 +13430,13 @@ out_unlocked: } } #endif +#ifdef INVARIANTS + if (inp) { + sctp_validate_no_locks(inp); + } else { + printf("Warning - inp is NULL so cant validate locks\n"); + } +#endif if (top) { sctp_m_freem(top); } Modified: projects/ppc64/sys/netinet/sctp_pcb.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_pcb.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_pcb.c Sun Jun 6 14:31:41 2010 (r208872) @@ -2296,7 +2296,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_asocidhash == NULL) { SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); - return error; + return (ENOBUFS); } #ifdef IPSEC { @@ -3107,29 +3107,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - SCTP_ITERATOR_LOCK(); - - so = inp->sctp_socket; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { - /* been here before.. eeks.. get out of here */ - SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); - SCTP_ITERATOR_UNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 1); -#endif - return; - } - SCTP_ASOC_CREATE_LOCK(inp); - SCTP_INP_INFO_WLOCK(); - - SCTP_INP_WLOCK(inp); - /* First time through we have the socket lock, after that no more. */ if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { /* * Once we are in we can remove the flag from = 1 is only * passed from the actual closing routines that are called * via the sockets layer. */ + SCTP_ITERATOR_LOCK(); inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; @@ -3138,7 +3122,22 @@ sctp_inpcb_free(struct sctp_inpcb *inp, /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); } + so = inp->sctp_socket; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { + /* been here before.. eeks.. get out of here */ + SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 1); +#endif + return; + } + SCTP_ASOC_CREATE_LOCK(inp); + SCTP_INP_INFO_WLOCK(); + + SCTP_INP_WLOCK(inp); + /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3164,8 +3163,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { /* Skip guys being freed */ - /* asoc->sctp_socket = NULL; FIXME MT */ cnt_in_sd++; + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + /* + * Special case - we did not start a + * kill timer on the asoc due to it + * was not closed. So go ahead and + * start it now. + */ + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } SCTP_TCB_UNLOCK(asoc); continue; } @@ -3329,7 +3337,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif @@ -3407,7 +3414,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif @@ -3419,7 +3425,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 4); #endif @@ -3541,7 +3546,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } @@ -4590,8 +4594,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Someone holds a reference OR the socket is unaccepted * yet. */ - if (stcb->asoc.refcnt) + if ((stcb->asoc.refcnt) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + } SCTP_TCB_UNLOCK(stcb); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) Modified: projects/ppc64/sys/netinet/sctp_pcb.h ============================================================================== --- projects/ppc64/sys/netinet/sctp_pcb.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_pcb.h Sun Jun 6 14:31:41 2010 (r208872) @@ -621,5 +621,11 @@ sctp_initiate_iterator(inp_func inpf, struct sctp_inpcb *, uint8_t co_off); +#ifdef INVARIANTS +void + sctp_validate_no_locks(struct sctp_inpcb *inp); + +#endif + #endif /* _KERNEL */ #endif /* !__sctp_pcb_h__ */ Modified: projects/ppc64/sys/netinet/sctp_usrreq.c ============================================================================== --- projects/ppc64/sys/netinet/sctp_usrreq.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctp_usrreq.c Sun Jun 6 14:31:41 2010 (r208872) @@ -4678,6 +4678,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in *sin; SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; @@ -4691,6 +4693,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in6 *sin6; SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; @@ -4756,6 +4760,8 @@ sctp_ingetaddr(struct socket *so, struct * Do the malloc first in case it blocks. */ SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); inp = (struct sctp_inpcb *)so->so_pcb; @@ -4858,6 +4864,8 @@ sctp_peeraddr(struct socket *so, struct return (ENOTCONN); } SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); Modified: projects/ppc64/sys/netinet/sctputil.c ============================================================================== --- projects/ppc64/sys/netinet/sctputil.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/netinet/sctputil.c Sun Jun 6 14:31:41 2010 (r208872) @@ -53,15 +53,9 @@ __FBSDID("$FreeBSD$"); #define NUMBER_OF_MTU_SIZES 18 -#if defined(__Windows__) && !defined(SCTP_LOCAL_TRACE_BUF) -#include "eventrace_netinet.h" -#include "sctputil.tmh" /* this is the file that will be auto - * generated */ -#else #ifndef KTR_SCTP #define KTR_SCTP KTR_SUBSYS #endif -#endif void sctp_sblog(struct sockbuf *sb, @@ -4207,7 +4201,7 @@ void sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh) { switch (iph->ip_v) { - case IPVERSION: + case IPVERSION: { struct sockaddr_in lsa, fsa; Modified: projects/ppc64/sys/powerpc/aim/mmu_oea.c ============================================================================== --- projects/ppc64/sys/powerpc/aim/mmu_oea.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/aim/mmu_oea.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1786,7 +1786,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) PMAP_UNLOCK(pmap); } if ((m->flags & PG_WRITEABLE) && moea_is_modified(mmu, m)) { - moea_attr_clear(m, LPTE_CHG); + moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); Modified: projects/ppc64/sys/powerpc/booke/pmap.c ============================================================================== --- projects/ppc64/sys/powerpc/booke/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/booke/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1596,7 +1596,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t if (!su) flags |= PTE_UW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((flags & PTE_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } else { /* Handle modified pages, sense modify status. */ @@ -1662,7 +1663,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t if (!su) flags |= PTE_UW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } if (prot & VM_PROT_EXECUTE) { Modified: projects/ppc64/sys/powerpc/powermac/macgpio.c ============================================================================== --- projects/ppc64/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/powermac/macgpio.c Sun Jun 6 14:31:41 2010 (r208872) @@ -98,6 +98,8 @@ static device_method_t macgpio_methods[] DEVMETHOD(bus_deactivate_resource, macgpio_deactivate_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, macgpio_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), Modified: projects/ppc64/sys/powerpc/powermac/uninorth.c ============================================================================== --- projects/ppc64/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/powerpc/powermac/uninorth.c Sun Jun 6 14:31:41 2010 (r208872) @@ -115,6 +115,8 @@ static device_method_t unin_chip_methods DEVMETHOD(bus_deactivate_resource, unin_chip_deactivate_resource), DEVMETHOD(bus_get_resource_list, unin_chip_get_resource_list), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, unin_chip_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), Modified: projects/ppc64/sys/sparc64/sparc64/pmap.c ============================================================================== --- projects/ppc64/sys/sparc64/sparc64/pmap.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/sparc64/sparc64/pmap.c Sun Jun 6 14:31:41 2010 (r208872) @@ -1409,7 +1409,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t tp->tte_data |= TD_SW; if (wired) tp->tte_data |= TD_W; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } else if ((data & TD_W) != 0) vm_page_dirty(m); @@ -1429,7 +1430,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t } else { /* * If there is an existing mapping, but its for a different - * phsyical address, delete the old mapping. + * physical address, delete the old mapping. */ if (tp != NULL) { CTR0(KTR_PMAP, "pmap_enter_locked: replace"); @@ -1449,7 +1450,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t data |= TD_P; if ((prot & VM_PROT_WRITE) != 0) { data |= TD_SW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + vm_page_flag_set(m, PG_WRITEABLE); } if (prot & VM_PROT_EXECUTE) { data |= TD_EXEC; Modified: projects/ppc64/sys/sys/pmc.h ============================================================================== --- projects/ppc64/sys/sys/pmc.h Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/sys/sys/pmc.h Sun Jun 6 14:31:41 2010 (r208872) @@ -680,7 +680,7 @@ struct pmc { enum pmc_event pm_event; /* event being measured */ uint32_t pm_flags; /* additional flags PMC_F_... */ struct pmc_owner *pm_owner; /* owner thread state */ - uint32_t pm_runcount; /* #cpus currently on */ + int pm_runcount; /* #cpus currently on */ enum pmc_state pm_state; /* current PMC state */ /* Modified: projects/ppc64/tools/tools/netrate/tcpp/README ============================================================================== --- projects/ppc64/tools/tools/netrate/tcpp/README Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/tools/tools/netrate/tcpp/README Sun Jun 6 14:31:41 2010 (r208872) @@ -39,6 +39,7 @@ The client has more to configure, with t -c Select client mode, and specific dest IP -C Print connections/second instead of GBps + -P Pin each worker to a CPU -M Number of sequential local IPs to use; req. -l -T Include CPU use summary in stats at end of run -b Data bytes per connection Modified: projects/ppc64/tools/tools/netrate/tcpp/tcpp.c ============================================================================== --- projects/ppc64/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 14:29:06 2010 (r208871) +++ projects/ppc64/tools/tools/netrate/tcpp/tcpp.c Sun Jun 6 14:31:41 2010 (r208872) @@ -51,7 +51,7 @@ struct sockaddr_in remoteip; /* Base target address. */ struct sockaddr_in localipbase; /* Base local address, if -l. */ -int cflag, lflag, mflag, pflag, sflag, tflag, Cflag, Mflag, Tflag; +int cflag, lflag, mflag, pflag, sflag, tflag, Cflag, Mflag, Pflag, Tflag; uint64_t bflag; u_short rflag; @@ -61,24 +61,27 @@ usage(void) fprintf(stderr, "client: tcpp" " -c remoteIP" - " [-CT]" + " [-CPT]" " [-M localIPcount]" " [-l localIPbase]" + "\n\t" " [-b bytespertcp]" " [-m maxtcpsatonce]" - "\n" - "\t" " [-p procs]" " [-t tcpsperproc]" + "\n" + "\t" " [-r baseport]" "\n"); fprintf(stderr, "server: tcpp" " -s" - " [-T]" + " [-PT]" " [-l localIPbase]" " [-m maxtcpsatonce]" " [-p procs]" + "\n" + "\t" " [-r baseport]" "\n"); exit(EX_USAGE); @@ -109,7 +112,7 @@ main(int argc, char *argv[]) rflag = BASEPORT_DEFAULT; tflag = TCPS_DEFAULT; Mflag = 1; - while ((ch = getopt(argc, argv, "b:c:l:m:p:r:st:CM:T")) != -1) { + while ((ch = getopt(argc, argv, "b:c:l:m:p:r:st:CM:PT")) != -1) { switch (ch) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sun Jun 6 21:19:05 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97C961065675; Sun, 6 Jun 2010 21:19:05 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 823E98FC12; Sun, 6 Jun 2010 21:19:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o56LJ57Y057498; Sun, 6 Jun 2010 21:19:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56LJ596057466; Sun, 6 Jun 2010 21:19:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006062119.o56LJ596057466@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Jun 2010 21:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208880 - in projects/altix/sys: amd64/acpica amd64/amd64 amd64/ia32 amd64/include arm/arm boot/fdt/dts boot/i386/boot0 boot/i386/btx/btx boot/i386/btx/btxldr boot/i386/cdboot boot/i386... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 21:19:05 -0000 Author: marcel Date: Sun Jun 6 21:19:04 2010 New Revision: 208880 URL: http://svn.freebsd.org/changeset/base/208880 Log: Merge svn+ssh://svn.freebsd.org/base/head@208879 Added: projects/altix/sys/boot/fdt/dts/ - copied from r208879, head/sys/boot/fdt/dts/ projects/altix/sys/dev/fdt/ - copied from r208879, head/sys/dev/fdt/ projects/altix/sys/dev/ofw/ofw_fdt.c - copied unchanged from r208879, head/sys/dev/ofw/ofw_fdt.c projects/altix/sys/dev/uart/uart_bus_fdt.c - copied unchanged from r208879, head/sys/dev/uart/uart_bus_fdt.c projects/altix/sys/libkern/memchr.c - copied unchanged from r208879, head/sys/libkern/memchr.c projects/altix/sys/powerpc/powermac/smusat.c - copied unchanged from r208879, head/sys/powerpc/powermac/smusat.c projects/altix/sys/tools/fdt/ - copied from r208879, head/sys/tools/fdt/ Modified: projects/altix/sys/amd64/acpica/acpi_wakeup.c projects/altix/sys/amd64/amd64/cpu_switch.S projects/altix/sys/amd64/amd64/fpu.c projects/altix/sys/amd64/amd64/machdep.c projects/altix/sys/amd64/amd64/mca.c projects/altix/sys/amd64/amd64/mp_machdep.c projects/altix/sys/amd64/amd64/pmap.c projects/altix/sys/amd64/amd64/trap.c projects/altix/sys/amd64/amd64/vm_machdep.c projects/altix/sys/amd64/ia32/ia32_reg.c projects/altix/sys/amd64/include/fpu.h projects/altix/sys/amd64/include/pcb.h projects/altix/sys/arm/arm/pmap.c projects/altix/sys/boot/i386/boot0/Makefile projects/altix/sys/boot/i386/btx/btx/Makefile projects/altix/sys/boot/i386/btx/btxldr/Makefile projects/altix/sys/boot/i386/cdboot/Makefile projects/altix/sys/boot/i386/mbr/Makefile projects/altix/sys/boot/i386/pmbr/Makefile projects/altix/sys/boot/pc98/boot0.5/Makefile projects/altix/sys/boot/pc98/boot0/Makefile projects/altix/sys/boot/pc98/btx/btx/Makefile projects/altix/sys/boot/pc98/btx/btxldr/Makefile projects/altix/sys/boot/pc98/cdboot/Makefile projects/altix/sys/boot/sparc64/boot1/Makefile projects/altix/sys/boot/zfs/zfs.c projects/altix/sys/boot/zfs/zfsimpl.c projects/altix/sys/cam/ata/ata_pmp.c projects/altix/sys/cam/ata/ata_xpt.c projects/altix/sys/cam/cam_ccb.h projects/altix/sys/cam/cam_periph.c projects/altix/sys/cam/cam_xpt.c projects/altix/sys/cam/scsi/scsi_cd.c projects/altix/sys/cam/scsi/scsi_xpt.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/altix/sys/conf/files.powerpc projects/altix/sys/conf/options projects/altix/sys/contrib/libfdt/libfdt_env.h projects/altix/sys/crypto/via/padlock.c projects/altix/sys/crypto/via/padlock.h projects/altix/sys/crypto/via/padlock_cipher.c projects/altix/sys/crypto/via/padlock_hash.c projects/altix/sys/dev/acpica/acpi_ec.c projects/altix/sys/dev/ahci/ahci.c projects/altix/sys/dev/amdsbwd/amdsbwd.c projects/altix/sys/dev/ata/ata-all.h projects/altix/sys/dev/ata/ata-lowlevel.c projects/altix/sys/dev/ata/atapi-cam.c projects/altix/sys/dev/ata/chipsets/ata-acerlabs.c projects/altix/sys/dev/ata/chipsets/ata-intel.c projects/altix/sys/dev/ata/chipsets/ata-serverworks.c projects/altix/sys/dev/ath/ath_hal/ah.h projects/altix/sys/dev/ath/ath_hal/ah_eeprom_v1.c projects/altix/sys/dev/ath/ath_hal/ah_eeprom_v4k.c projects/altix/sys/dev/ath/ath_hal/ah_eeprom_v4k.h projects/altix/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c projects/altix/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416phy.h projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/altix/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c projects/altix/sys/dev/bge/if_bge.c projects/altix/sys/dev/bge/if_bgereg.h projects/altix/sys/dev/cas/if_cas.c projects/altix/sys/dev/fdc/fdc_acpi.c projects/altix/sys/dev/hwpmc/hwpmc_mod.c projects/altix/sys/dev/iicbus/iic.h projects/altix/sys/dev/isp/isp.c projects/altix/sys/dev/isp/isp_freebsd.c projects/altix/sys/dev/isp/isp_library.c projects/altix/sys/dev/isp/isp_pci.c projects/altix/sys/dev/ixgbe/ixgbe.c projects/altix/sys/dev/ixgbe/ixgbe.h projects/altix/sys/dev/mvs/mvs.c projects/altix/sys/dev/ofw/ofw_bus_subr.c projects/altix/sys/dev/ofw/ofw_bus_subr.h projects/altix/sys/dev/ofw/ofw_if.m projects/altix/sys/dev/ofw/ofw_standard.c projects/altix/sys/dev/ofw/openfirm.c projects/altix/sys/dev/ofw/openfirm.h projects/altix/sys/dev/random/nehemiah.c projects/altix/sys/dev/sge/if_sge.c projects/altix/sys/dev/siis/siis.c projects/altix/sys/fs/devfs/devfs_vnops.c projects/altix/sys/fs/udf/udf_vnops.c projects/altix/sys/geom/label/g_label.c projects/altix/sys/geom/mountver/g_mountver.c projects/altix/sys/geom/part/g_part_bsd.c projects/altix/sys/geom/part/g_part_gpt.c projects/altix/sys/i386/i386/machdep.c projects/altix/sys/i386/i386/mca.c projects/altix/sys/i386/i386/pmap.c projects/altix/sys/i386/i386/ptrace_machdep.c projects/altix/sys/i386/i386/swtch.s projects/altix/sys/i386/i386/trap.c projects/altix/sys/i386/i386/vm_machdep.c projects/altix/sys/i386/include/npx.h projects/altix/sys/i386/include/pcb.h projects/altix/sys/i386/include/pcpu.h projects/altix/sys/i386/isa/npx.c projects/altix/sys/i386/linux/linux_ptrace.c projects/altix/sys/i386/xen/pmap.c projects/altix/sys/ia64/ia64/pmap.c projects/altix/sys/isa/syscons_isa.c projects/altix/sys/kern/kern_jail.c projects/altix/sys/kern/kern_proc.c projects/altix/sys/kern/posix4_mib.c projects/altix/sys/kern/sched_4bsd.c projects/altix/sys/kern/sched_ule.c projects/altix/sys/kern/subr_acl_nfs4.c projects/altix/sys/kern/subr_acl_posix1e.c projects/altix/sys/kern/subr_taskqueue.c projects/altix/sys/kern/subr_trap.c projects/altix/sys/kern/uipc_sem.c projects/altix/sys/kern/uipc_shm.c projects/altix/sys/kern/uipc_socket.c projects/altix/sys/kern/vfs_acl.c projects/altix/sys/kern/vfs_bio.c projects/altix/sys/kern/vfs_subr.c projects/altix/sys/mips/mips/pmap.c projects/altix/sys/mips/mips/tick.c projects/altix/sys/mips/mips/uio_machdep.c projects/altix/sys/modules/Makefile projects/altix/sys/modules/iwnfw/Makefile.inc projects/altix/sys/modules/zfs/Makefile projects/altix/sys/net/vnet.h projects/altix/sys/net80211/ieee80211_hwmp.c projects/altix/sys/net80211/ieee80211_ioctl.c projects/altix/sys/net80211/ieee80211_scan_sta.c projects/altix/sys/netgraph/ng_pppoe.c projects/altix/sys/netinet/ip_mroute.c projects/altix/sys/netinet/ip_mroute.h projects/altix/sys/netinet/pim_var.h projects/altix/sys/netinet/sctp_auth.c projects/altix/sys/netinet/sctp_bsd_addr.c projects/altix/sys/netinet/sctp_constants.h projects/altix/sys/netinet/sctp_indata.c projects/altix/sys/netinet/sctp_input.c projects/altix/sys/netinet/sctp_lock_bsd.h projects/altix/sys/netinet/sctp_output.c projects/altix/sys/netinet/sctp_pcb.c projects/altix/sys/netinet/sctp_pcb.h projects/altix/sys/netinet/sctp_sysctl.c projects/altix/sys/netinet/sctp_usrreq.c projects/altix/sys/netinet/sctputil.c projects/altix/sys/nfsclient/nfs_vfsops.c projects/altix/sys/nfsclient/nfs_vnops.c projects/altix/sys/opencrypto/crypto.c projects/altix/sys/pc98/cbus/syscons_cbus.c projects/altix/sys/pc98/pc98/machdep.c projects/altix/sys/powerpc/aim/mmu_oea.c projects/altix/sys/powerpc/aim/mmu_oea64.c projects/altix/sys/powerpc/booke/pmap.c projects/altix/sys/powerpc/ofw/ofw_real.c projects/altix/sys/powerpc/powermac/kiic.c projects/altix/sys/powerpc/powermac/macgpio.c projects/altix/sys/powerpc/powermac/smu.c projects/altix/sys/powerpc/powermac/uninorth.c projects/altix/sys/powerpc/powerpc/intr_machdep.c projects/altix/sys/sparc64/sparc64/pmap.c projects/altix/sys/sun4v/sun4v/pmap.c projects/altix/sys/sys/_task.h projects/altix/sys/sys/libkern.h projects/altix/sys/sys/pmc.h projects/altix/sys/sys/posix4.h projects/altix/sys/sys/sysent.h projects/altix/sys/sys/taskqueue.h projects/altix/sys/sys/user.h projects/altix/sys/sys/vtoc.h projects/altix/sys/ufs/ufs/ufs_quota.c projects/altix/sys/vm/vm_contig.c projects/altix/sys/vm/vm_map.c projects/altix/sys/vm/vm_mmap.c projects/altix/sys/vm/vm_page.c projects/altix/sys/vm/vm_page.h projects/altix/sys/vm/vm_pageout.h projects/altix/sys/vm/vnode_pager.c Directory Properties: projects/altix/lib/libstand/ (props changed) projects/altix/sys/ (props changed) projects/altix/sys/amd64/include/xen/ (props changed) projects/altix/sys/cddl/contrib/opensolaris/ (props changed) projects/altix/sys/contrib/dev/acpica/ (props changed) projects/altix/sys/contrib/x86emu/ (props changed) projects/altix/sys/dev/xen/xenpci/ (props changed) Modified: projects/altix/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- projects/altix/sys/amd64/acpica/acpi_wakeup.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/acpica/acpi_wakeup.c Sun Jun 6 21:19:04 2010 (r208880) @@ -245,7 +245,7 @@ acpi_sleep_machdep(struct acpi_softc *sc cr3 = rcr3(); load_cr3(KPML4phys); - stopfpu = &stopxpcbs[0]->xpcb_pcb.pcb_save; + stopfpu = stopxpcbs[0]->xpcb_pcb.pcb_save; if (acpi_savecpu(stopxpcbs[0])) { fpugetregs(curthread, stopfpu); Modified: projects/altix/sys/amd64/amd64/cpu_switch.S ============================================================================== --- projects/altix/sys/amd64/amd64/cpu_switch.S Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/cpu_switch.S Sun Jun 6 21:19:04 2010 (r208880) @@ -116,7 +116,7 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) jne 1f - addq $PCB_SAVEFPU,%r8 + movq PCB_SAVEFPU(%r8),%r8 clts fxsave (%r8) smsw %ax @@ -341,7 +341,7 @@ ENTRY(savectx) je 1f movq TD_PCB(%rax),%rdi - leaq PCB_SAVEFPU(%rdi),%rdi + movq PCB_SAVEFPU(%rdi),%rdi clts fxsave (%rdi) smsw %ax @@ -349,7 +349,7 @@ ENTRY(savectx) lmsw %ax movq $PCB_SAVEFPU_SIZE,%rdx /* arg 3 */ - leaq PCB_SAVEFPU(%rcx),%rsi /* arg 2 */ + movq PCB_SAVEFPU(%rcx),%rsi /* arg 2 */ /* arg 1 (%rdi) already loaded */ call bcopy 1: Modified: projects/altix/sys/amd64/amd64/fpu.c ============================================================================== --- projects/altix/sys/amd64/amd64/fpu.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/fpu.c Sun Jun 6 21:19:04 2010 (r208880) @@ -91,8 +91,8 @@ void stop_emulating(void); #endif /* __GNUCLIKE_ASM && !lint */ -#define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save.sv_env.en_cw) -#define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save.sv_env.en_sw) +#define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) +#define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) typedef u_char bool_t; @@ -146,7 +146,7 @@ fpuexit(struct thread *td) savecrit = intr_disable(); if (curthread == PCPU_GET(fpcurthread)) { stop_emulating(); - fxsave(&PCPU_GET(curpcb)->pcb_save); + fxsave(PCPU_GET(curpcb)->pcb_save); start_emulating(); PCPU_SET(fpcurthread, 0); } @@ -424,8 +424,10 @@ fpudna(void) if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(&pcb->pcb_initial_fpucw); pcb->pcb_flags |= PCB_FPUINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_USERFPUINITDONE; } else - fxrstor(&pcb->pcb_save); + fxrstor(pcb->pcb_save); intr_restore(s); } @@ -449,13 +451,39 @@ fpudrop() * It returns the FPU ownership status. */ int +fpugetuserregs(struct thread *td, struct savefpu *addr) +{ + struct pcb *pcb; + register_t s; + + pcb = td->td_pcb; + if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { + bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate)); + addr->sv_env.en_cw = pcb->pcb_initial_fpucw; + return (_MC_FPOWNED_NONE); + } + s = intr_disable(); + if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { + fxsave(addr); + intr_restore(s); + return (_MC_FPOWNED_FPU); + } else { + intr_restore(s); + bcopy(&pcb->pcb_user_save, addr, sizeof(*addr)); + return (_MC_FPOWNED_PCB); + } +} + +int fpugetregs(struct thread *td, struct savefpu *addr) { + struct pcb *pcb; register_t s; - if ((td->td_pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + pcb = td->td_pcb; + if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate)); - addr->sv_env.en_cw = td->td_pcb->pcb_initial_fpucw; + addr->sv_env.en_cw = pcb->pcb_initial_fpucw; return (_MC_FPOWNED_NONE); } s = intr_disable(); @@ -465,7 +493,7 @@ fpugetregs(struct thread *td, struct sav return (_MC_FPOWNED_FPU); } else { intr_restore(s); - bcopy(&td->td_pcb->pcb_save, addr, sizeof(*addr)); + bcopy(pcb->pcb_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } } @@ -474,19 +502,44 @@ fpugetregs(struct thread *td, struct sav * Set the state of the FPU. */ void +fpusetuserregs(struct thread *td, struct savefpu *addr) +{ + struct pcb *pcb; + register_t s; + + pcb = td->td_pcb; + s = intr_disable(); + if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { + fxrstor(addr); + intr_restore(s); + pcb->pcb_flags |= PCB_FPUINITDONE | PCB_USERFPUINITDONE; + } else { + intr_restore(s); + bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr)); + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_FPUINITDONE; + pcb->pcb_flags |= PCB_USERFPUINITDONE; + } +} + +void fpusetregs(struct thread *td, struct savefpu *addr) { + struct pcb *pcb; register_t s; + pcb = td->td_pcb; s = intr_disable(); if (td == PCPU_GET(fpcurthread)) { fxrstor(addr); intr_restore(s); } else { intr_restore(s); - bcopy(addr, &td->td_pcb->pcb_save, sizeof(*addr)); + bcopy(addr, td->td_pcb->pcb_save, sizeof(*addr)); } - curthread->td_pcb->pcb_flags |= PCB_FPUINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_USERFPUINITDONE; + pcb->pcb_flags |= PCB_FPUINITDONE; } /* @@ -575,3 +628,74 @@ static devclass_t fpupnp_devclass; DRIVER_MODULE(fpupnp, acpi, fpupnp_driver, fpupnp_devclass, 0, 0); #endif /* DEV_ISA */ + +int +fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags) +{ + struct pcb *pcb; + + pcb = td->td_pcb; + KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == &pcb->pcb_user_save, + ("mangled pcb_save")); + ctx->flags = 0; + if ((pcb->pcb_flags & PCB_FPUINITDONE) != 0) + ctx->flags |= FPU_KERN_CTX_FPUINITDONE; + fpuexit(td); + ctx->prev = pcb->pcb_save; + pcb->pcb_save = &ctx->hwstate; + pcb->pcb_flags |= PCB_KERNFPU; + pcb->pcb_flags &= ~PCB_FPUINITDONE; + return (0); +} + +int +fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx) +{ + struct pcb *pcb; + register_t savecrit; + + pcb = td->td_pcb; + savecrit = intr_disable(); + if (curthread == PCPU_GET(fpcurthread)) + fpudrop(); + intr_restore(savecrit); + pcb->pcb_save = ctx->prev; + if (pcb->pcb_save == &pcb->pcb_user_save) { + if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) + pcb->pcb_flags |= PCB_FPUINITDONE; + else + pcb->pcb_flags &= ~PCB_FPUINITDONE; + pcb->pcb_flags &= ~PCB_KERNFPU; + } else { + if ((ctx->flags & FPU_KERN_CTX_FPUINITDONE) != 0) + pcb->pcb_flags |= PCB_FPUINITDONE; + else + pcb->pcb_flags &= ~PCB_FPUINITDONE; + KASSERT(!PCB_USER_FPU(pcb), ("unpaired fpu_kern_leave")); + } + return (0); +} + +int +fpu_kern_thread(u_int flags) +{ + struct pcb *pcb; + + pcb = PCPU_GET(curpcb); + KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, + ("Only kthread may use fpu_kern_thread")); + KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save")); + KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + + pcb->pcb_flags |= PCB_KERNFPU; + return (0); +} + +int +is_fpu_kern_thread(u_int flags) +{ + + if ((curthread->td_pflags & TDP_KTHREAD) == 0) + return (0); + return ((PCPU_GET(curpcb)->pcb_flags & PCB_KERNFPU) != 0); +} Modified: projects/altix/sys/amd64/amd64/machdep.c ============================================================================== --- projects/altix/sys/amd64/amd64/machdep.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/machdep.c Sun Jun 6 21:19:04 2010 (r208880) @@ -285,7 +285,6 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); - mca_init(); } /* @@ -1961,7 +1960,7 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - fill_fpregs_xmm(&td->td_pcb->pcb_save, fpregs); + fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); return (0); } @@ -1970,7 +1969,7 @@ int set_fpregs(struct thread *td, struct fpreg *fpregs) { - set_fpregs_xmm(fpregs, &td->td_pcb->pcb_save); + set_fpregs_xmm(fpregs, &td->td_pcb->pcb_user_save); return (0); } @@ -2085,7 +2084,8 @@ static void get_fpcontext(struct thread *td, mcontext_t *mcp) { - mcp->mc_ownedfp = fpugetregs(td, (struct savefpu *)&mcp->mc_fpstate); + mcp->mc_ownedfp = fpugetuserregs(td, + (struct savefpu *)&mcp->mc_fpstate); mcp->mc_fpformat = fpuformat(); } @@ -2110,7 +2110,7 @@ set_fpcontext(struct thread *td, const m */ fpstate = (struct savefpu *)&mcp->mc_fpstate; fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; - fpusetregs(td, fpstate); + fpusetuserregs(td, fpstate); } else return (EINVAL); return (0); @@ -2121,6 +2121,7 @@ fpstate_drop(struct thread *td) { register_t s; + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); s = intr_disable(); if (PCPU_GET(fpcurthread) == td) fpudrop(); @@ -2134,7 +2135,8 @@ fpstate_drop(struct thread *td) * sendsig() is the only caller of fpugetregs()... perhaps we just * have too many layers. */ - curthread->td_pcb->pcb_flags &= ~PCB_FPUINITDONE; + curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE | + PCB_USERFPUINITDONE); intr_restore(s); } Modified: projects/altix/sys/amd64/amd64/mca.c ============================================================================== --- projects/altix/sys/amd64/amd64/mca.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/mca.c Sun Jun 6 21:19:04 2010 (r208880) @@ -789,6 +789,19 @@ mca_init(void) load_cr4(rcr4() | CR4_MCE); } +/* + * The machine check registers for the BSP cannot be initialized until + * the local APIC is initialized. This happens at SI_SUB_CPU, + * SI_ORDER_SECOND. + */ +static void +mca_init_bsp(void *arg __unused) +{ + + mca_init(); +} +SYSINIT(mca_init_bsp, SI_SUB_CPU, SI_ORDER_ANY, mca_init_bsp, NULL); + /* Called when a machine check exception fires. */ int mca_intr(void) Modified: projects/altix/sys/amd64/amd64/mp_machdep.c ============================================================================== --- projects/altix/sys/amd64/amd64/mp_machdep.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/mp_machdep.c Sun Jun 6 21:19:04 2010 (r208880) @@ -1247,7 +1247,7 @@ cpususpend_handler(void) rf = intr_disable(); cr3 = rcr3(); - stopfpu = &stopxpcbs[cpu]->xpcb_pcb.pcb_save; + stopfpu = stopxpcbs[cpu]->xpcb_pcb.pcb_save; if (savectx2(stopxpcbs[cpu])) { fpugetregs(curthread, stopfpu); wbinvd(); Modified: projects/altix/sys/amd64/amd64/pmap.c ============================================================================== --- projects/altix/sys/amd64/amd64/pmap.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/pmap.c Sun Jun 6 21:19:04 2010 (r208880) @@ -2041,7 +2041,6 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_coll static void pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) { - struct md_page *pvh; pd_entry_t *pde; pmap_t pmap; pt_entry_t *pte, tpte; @@ -2077,15 +2076,13 @@ pmap_collect(pmap_t locked_pmap, struct pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - if (TAILQ_EMPTY(&m->md.pv_list)) { - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - if (TAILQ_EMPTY(&pvh->pv_list)) - vm_page_flag_clear(m, PG_WRITEABLE); - } free_pv_entry(pmap, pv); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } + if (TAILQ_EMPTY(&m->md.pv_list) && + TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)) + vm_page_flag_clear(m, PG_WRITEABLE); } } @@ -2796,6 +2793,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_remove_all: page %p is fictitious", m)); + free = NULL; vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { @@ -2825,16 +2823,15 @@ pmap_remove_all(vm_page_t m) */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - free = NULL; pmap_unuse_pt(pmap, pv->pv_va, *pde, &free); pmap_invalidate_page(pmap, pv->pv_va); - pmap_free_zero_pages(free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } vm_page_flag_clear(m, PG_WRITEABLE); vm_page_unlock_queues(); + pmap_free_zero_pages(free); } /* @@ -3128,11 +3125,11 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_paddr_t pa; pd_entry_t *pde; pt_entry_t *pte; - vm_paddr_t opa; - pt_entry_t origpte, newpte; + pt_entry_t newpte, origpte; + pv_entry_t pv; + vm_paddr_t opa, pa; vm_page_t mpte, om; boolean_t invlva; @@ -3190,16 +3187,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (mpte) mpte->wire_count--; - /* - * We might be turning off write access to the page, - * so we go ahead and sense modify status. - */ if (origpte & PG_MANAGED) { om = m; pa |= PG_MANAGED; } goto validate; } + + pv = NULL; + /* * Mapping has changed, invalidate old range and fall through to * handle validating new mapping. @@ -3209,7 +3205,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count--; if (origpte & PG_MANAGED) { om = PHYS_TO_VM_PAGE(opa); - pmap_remove_entry(pmap, om, va); + pv = pmap_pvh_remove(&om->md, pmap, va); } if (mpte != NULL) { mpte->wire_count--; @@ -3226,9 +3222,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - pmap_insert_entry(pmap, va, m); + if (pv == NULL) + pv = get_pv_entry(pmap, FALSE); + pv->pv_va = va; + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); pa |= PG_MANAGED; - } + } else if (pv != NULL) + free_pv_entry(pmap, pv); /* * Increment counters @@ -3243,7 +3243,8 @@ validate: newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); if ((prot & VM_PROT_WRITE) != 0) { newpte |= PG_RW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((newpte & PG_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; @@ -3278,6 +3279,10 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } + if ((origpte & PG_MANAGED) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + vm_page_flag_clear(om, PG_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); } else @@ -3389,6 +3394,7 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -3402,6 +3408,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -4209,12 +4216,15 @@ pmap_is_prefaultable(pmap_t pmap, vm_off boolean_t pmap_is_referenced(vm_page_t m) { + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - if (pmap_is_referenced_pvh(&m->md)) - return (TRUE); - return (pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + vm_page_lock_queues(); + rv = pmap_is_referenced_pvh(&m->md) || + pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + vm_page_unlock_queues(); + return (rv); } /* Modified: projects/altix/sys/amd64/amd64/trap.c ============================================================================== --- projects/altix/sys/amd64/amd64/trap.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/trap.c Sun Jun 6 21:19:04 2010 (r208880) @@ -425,6 +425,8 @@ trap(struct trapframe *frame) case T_DNA: /* transparent fault (due to context switch "late") */ + KASSERT(PCB_USER_FPU(td->td_pcb), + ("kernel FPU ctx has leaked")); fpudna(); goto userout; @@ -449,16 +451,19 @@ trap(struct trapframe *frame) goto out; case T_DNA: + KASSERT(!PCB_USER_FPU(td->td_pcb), + ("Unregistered use of FPU in kernel")); + fpudna(); + goto out; + + case T_ARITHTRAP: /* arithmetic trap */ + case T_XMMFLT: /* SIMD floating-point exception */ + case T_FPOPFLT: /* FPU operand fetch fault */ /* - * The kernel is apparently using fpu for copying. - * XXX this should be fatal unless the kernel has - * registered such use. + * XXXKIB for now disable any FPU traps in kernel + * handler registration seems to be overkill */ - printf("fpudna in kernel mode!\n"); -#ifdef KDB - kdb_backtrace(); -#endif - fpudna(); + trap_fatal(frame, 0); goto out; case T_STKFLT: /* stack fault */ @@ -603,6 +608,8 @@ trap(struct trapframe *frame) user: userret(td, frame); mtx_assert(&Giant, MA_NOTOWNED); + KASSERT(PCB_USER_FPU(td->td_pcb), + ("Return from trap with kernel FPU ctx leaked")); userout: out: return; @@ -891,5 +898,12 @@ syscall(struct trapframe *frame) trapsignal(td, &ksi); } + KASSERT(PCB_USER_FPU(td->td_pcb), + ("System call %s returing with kernel FPU ctx leaked", + syscallname(td->td_proc, sa.code))); + KASSERT(td->td_pcb->pcb_save == &td->td_pcb->pcb_user_save, + ("System call %s returning with mangled pcb_save", + syscallname(td->td_proc, sa.code))); + syscallret(td, error, &sa); } Modified: projects/altix/sys/amd64/amd64/vm_machdep.c ============================================================================== --- projects/altix/sys/amd64/amd64/vm_machdep.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/amd64/vm_machdep.c Sun Jun 6 21:19:04 2010 (r208880) @@ -122,7 +122,7 @@ cpu_fork(td1, p2, td2, flags) return; } - /* Ensure that p1's pcb is up to date. */ + /* Ensure that td1's pcb is up to date. */ fpuexit(td1); /* Point the pcb to the top of the stack */ @@ -130,9 +130,12 @@ cpu_fork(td1, p2, td2, flags) td2->td_kstack_pages * PAGE_SIZE) - 1; td2->td_pcb = pcb2; - /* Copy p1's pcb */ + /* Copy td1's pcb */ bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); + /* Properly initialize pcb_save */ + pcb2->pcb_save = &pcb2->pcb_user_save; + /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); @@ -308,6 +311,7 @@ cpu_thread_alloc(struct thread *td) td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages * PAGE_SIZE) - 1; td->td_frame = (struct trapframe *)td->td_pcb - 1; + td->td_pcb->pcb_save = &td->td_pcb->pcb_user_save; } void @@ -381,7 +385,8 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~PCB_FPUINITDONE; + pcb2->pcb_flags &= ~(PCB_FPUINITDONE | PCB_USERFPUINITDONE); + pcb2->pcb_save = &pcb2->pcb_user_save; pcb2->pcb_full_iret = 1; /* Modified: projects/altix/sys/amd64/ia32/ia32_reg.c ============================================================================== --- projects/altix/sys/amd64/ia32/ia32_reg.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/ia32/ia32_reg.c Sun Jun 6 21:19:04 2010 (r208880) @@ -147,7 +147,7 @@ fill_fpregs32(struct thread *td, struct { struct save87 *sv_87 = (struct save87 *)regs; struct env87 *penv_87 = &sv_87->sv_env; - struct savefpu *sv_fpu = &td->td_pcb->pcb_save; + struct savefpu *sv_fpu = &td->td_pcb->pcb_user_save; struct envxmm *penv_xmm = &sv_fpu->sv_env; int i; @@ -182,7 +182,7 @@ set_fpregs32(struct thread *td, struct f { struct save87 *sv_87 = (struct save87 *)regs; struct env87 *penv_87 = &sv_87->sv_env; - struct savefpu *sv_fpu = &td->td_pcb->pcb_save; + struct savefpu *sv_fpu = &td->td_pcb->pcb_user_save; struct envxmm *penv_xmm = &sv_fpu->sv_env; int i; Modified: projects/altix/sys/amd64/include/fpu.h ============================================================================== --- projects/altix/sys/amd64/include/fpu.h Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/include/fpu.h Sun Jun 6 21:19:04 2010 (r208880) @@ -73,6 +73,17 @@ struct savefpu { u_char sv_pad[96]; } __aligned(16); +#ifdef _KERNEL +struct fpu_kern_ctx { + struct savefpu hwstate; + struct savefpu *prev; + uint32_t flags; +}; +#define FPU_KERN_CTX_FPUINITDONE 0x01 + +#define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNFPU) == 0) +#endif + /* * The hardware default control word for i387's and later coprocessors is * 0x37F, giving: @@ -102,9 +113,22 @@ void fpudrop(void); void fpuexit(struct thread *td); int fpuformat(void); int fpugetregs(struct thread *td, struct savefpu *addr); +int fpugetuserregs(struct thread *td, struct savefpu *addr); void fpuinit(void); void fpusetregs(struct thread *td, struct savefpu *addr); +void fpusetuserregs(struct thread *td, struct savefpu *addr); int fputrap(void); +int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, + u_int flags); +int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx); +int fpu_kern_thread(u_int flags); +int is_fpu_kern_thread(u_int flags); + +/* + * Flags for fpu_kern_enter() and fpu_kern_thread(). + */ +#define FPU_KERN_NORMAL 0x0000 + #endif #endif /* !_MACHINE_FPU_H_ */ Modified: projects/altix/sys/amd64/include/pcb.h ============================================================================== --- projects/altix/sys/amd64/include/pcb.h Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/amd64/include/pcb.h Sun Jun 6 21:19:04 2010 (r208880) @@ -57,7 +57,9 @@ struct pcb { register_t pcb_gsbase; u_long pcb_flags; #define PCB_DBREGS 0x02 /* process using debug registers */ +#define PCB_KERNFPU 0x04 /* kernel uses fpu */ #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ +#define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ #define PCB_GS32BIT 0x20 /* linux gs switch */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ #define PCB_FULLCTX 0x80 /* full context restore on sysret */ @@ -69,7 +71,7 @@ struct pcb { u_int64_t pcb_dr6; u_int64_t pcb_dr7; - struct savefpu pcb_save; + struct savefpu pcb_user_save; uint16_t pcb_initial_fpucw; caddr_t pcb_onfault; /* copyin/out fault recovery */ @@ -78,6 +80,7 @@ struct pcb { struct user_segment_descriptor pcb_gs32sd; /* local tss, with i/o bitmap; NULL for common */ struct amd64tss *pcb_tssp; + struct savefpu *pcb_save; char pcb_full_iret; }; Modified: projects/altix/sys/arm/arm/pmap.c ============================================================================== --- projects/altix/sys/arm/arm/pmap.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/arm/arm/pmap.c Sun Jun 6 21:19:04 2010 (r208880) @@ -3318,15 +3318,16 @@ pmap_enter_locked(pmap_t pmap, vm_offset u_int oflags; vm_paddr_t pa; - KASSERT((m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, - ("pmap_enter_locked: page %p is not busy", m)); PMAP_ASSERT_LOCKED(pmap); mtx_assert(&vm_page_queue_mtx, MA_OWNED); if (va == vector_page) { pa = systempage.pv_pa; m = NULL; - } else + } else { + KASSERT((m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, + ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); + } nflags = 0; if (prot & VM_PROT_WRITE) nflags |= PVF_WRITE; @@ -3411,7 +3412,8 @@ do_l2b_alloc: if (prot & VM_PROT_WRITE) { npte |= L2_S_PROT_W; - if (m != NULL) + if (m != NULL && + (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) vm_page_flag_set(m, PG_WRITEABLE); } npte |= pte_l2_s_cache_mode; @@ -3589,12 +3591,14 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -4521,8 +4525,9 @@ boolean_t pmap_is_referenced(vm_page_t m) { - return ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && - (m->md.pvh_attrs & PVF_REF) != 0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + return ((m->md.pvh_attrs & PVF_REF) != 0); } /* Modified: projects/altix/sys/boot/i386/boot0/Makefile ============================================================================== --- projects/altix/sys/boot/i386/boot0/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/boot0/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -74,6 +74,6 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ -DTICKS=${BOOT_BOOT0_TICKS} \ -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} -LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/i386/btx/btx/Makefile ============================================================================== --- projects/altix/sys/boot/i386/btx/btx/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/btx/btx/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -24,6 +24,6 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COM ORG= 0x9000 -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- projects/altix/sys/boot/i386/btx/btxldr/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/btx/btxldr/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -11,6 +11,6 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-N -e start -Ttext ${LOADER_ADDRESS} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/i386/cdboot/Makefile ============================================================================== --- projects/altix/sys/boot/i386/cdboot/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/cdboot/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -8,6 +8,6 @@ SRCS= ${PROG}.s ORG= 0x7c00 -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/i386/mbr/Makefile ============================================================================== --- projects/altix/sys/boot/i386/mbr/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/mbr/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -12,6 +12,6 @@ BOOT_MBR_FLAGS?= 0x80 ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/i386/pmbr/Makefile ============================================================================== --- projects/altix/sys/boot/i386/pmbr/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/i386/pmbr/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -9,6 +9,6 @@ SRCS= ${PROG}.s ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/pc98/boot0.5/Makefile ============================================================================== --- projects/altix/sys/boot/pc98/boot0.5/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/pc98/boot0.5/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -14,7 +14,7 @@ BOOT= boot0.5 # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 -LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-T,${.CURDIR}/ldscript +LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin Modified: projects/altix/sys/boot/pc98/boot0/Makefile ============================================================================== --- projects/altix/sys/boot/pc98/boot0/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/pc98/boot0/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -13,7 +13,7 @@ BOOT= boot0 # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 -LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} +LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N ${BOOT}: ${BOOT}.out objcopy -S -O binary ${BOOT}.out ${.TARGET} Modified: projects/altix/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- projects/altix/sys/boot/pc98/btx/btx/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/pc98/btx/btx/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -24,6 +24,6 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COM ORG= 0x9000 -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- projects/altix/sys/boot/pc98/btx/btxldr/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/pc98/btx/btxldr/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -11,6 +11,6 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-N -e start -Ttext ${LOADER_ADDRESS} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/pc98/cdboot/Makefile ============================================================================== --- projects/altix/sys/boot/pc98/cdboot/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/pc98/cdboot/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -8,6 +8,6 @@ SRCS= ${PROG}.s ORG= 0x0000 -LDFLAGS=-N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include Modified: projects/altix/sys/boot/sparc64/boot1/Makefile ============================================================================== --- projects/altix/sys/boot/sparc64/boot1/Makefile Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/sparc64/boot1/Makefile Sun Jun 6 21:19:04 2010 (r208880) @@ -9,7 +9,7 @@ SRCS= _start.s boot1.c BOOTBLOCKBASE= 0x4000 CFLAGS= -mcmodel=medlow -Os -I${.CURDIR}/../../common -LDFLAGS=-N -Ttext ${BOOTBLOCKBASE} +LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. Modified: projects/altix/sys/boot/zfs/zfs.c ============================================================================== --- projects/altix/sys/boot/zfs/zfs.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/zfs/zfs.c Sun Jun 6 21:19:04 2010 (r208880) @@ -265,6 +265,8 @@ zfs_readdir(struct open_file *f, struct rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, &mze, sizeof(mze)); + if (rc) + return (rc); fp->f_seekp += sizeof(mze); if (!mze.mze_name[0]) Modified: projects/altix/sys/boot/zfs/zfsimpl.c ============================================================================== --- projects/altix/sys/boot/zfs/zfsimpl.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/boot/zfs/zfsimpl.c Sun Jun 6 21:19:04 2010 (r208880) @@ -958,12 +958,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -994,9 +999,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); Modified: projects/altix/sys/cam/ata/ata_pmp.c ============================================================================== --- projects/altix/sys/cam/ata/ata_pmp.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/cam/ata/ata_pmp.c Sun Jun 6 21:19:04 2010 (r208880) @@ -737,10 +737,8 @@ pmpdone(struct cam_periph *periph, union if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), i, 0) != CAM_REQ_CMP) { - printf("pmpdone: xpt_create_path failed" - ", bus scan halted\n"); - xpt_free_ccb(done_ccb); - goto done; + printf("pmpdone: xpt_create_path failed\n"); + continue; } /* If we did hard reset to this device, inform XPT. */ if ((softc->reset & softc->found & (1 << i)) != 0) Modified: projects/altix/sys/cam/ata/ata_xpt.c ============================================================================== --- projects/altix/sys/cam/ata/ata_xpt.c Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/cam/ata/ata_xpt.c Sun Jun 6 21:19:04 2010 (r208880) @@ -1185,6 +1185,7 @@ ata_scan_bus(struct cam_periph *periph, ("xpt_scan_bus\n")); switch (request_ccb->ccb_h.func_code) { case XPT_SCAN_BUS: + case XPT_SCAN_TGT: /* Find out the characteristics of the bus */ work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { @@ -1209,6 +1210,12 @@ ata_scan_bus(struct cam_periph *periph, !(work_ccb->cpi.hba_misc & PIM_NOBUSRESET) && !timevalisset(&request_ccb->ccb_h.path->bus->last_reset)) { reset_ccb = xpt_alloc_ccb_nowait(); + if (reset_ccb == NULL) { + request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_free_ccb(work_ccb); + xpt_done(request_ccb); + return; + } xpt_setup_ccb(&reset_ccb->ccb_h, request_ccb->ccb_h.path, CAM_PRIORITY_NONE); reset_ccb->ccb_h.func_code = XPT_RESET_BUS; @@ -1228,6 +1235,7 @@ ata_scan_bus(struct cam_periph *periph, malloc(sizeof(ata_scan_bus_info), M_CAMXPT, M_NOWAIT); if (scan_info == NULL) { request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_free_ccb(work_ccb); xpt_done(request_ccb); return; } @@ -1526,6 +1534,7 @@ ata_action(union ccb *start_ccb) break; } case XPT_SCAN_BUS: + case XPT_SCAN_TGT: ata_scan_bus(start_ccb->ccb_h.path->periph, start_ccb); break; case XPT_SCAN_LUN: Modified: projects/altix/sys/cam/cam_ccb.h ============================================================================== --- projects/altix/sys/cam/cam_ccb.h Sun Jun 6 20:34:17 2010 (r208879) +++ projects/altix/sys/cam/cam_ccb.h Sun Jun 6 21:19:04 2010 (r208880) @@ -184,6 +184,11 @@ typedef enum { /* * Set SIM specific knob values. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Jun 7 01:49:25 2010 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1D2106564A; Mon, 7 Jun 2010 01:49:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9A18FC0C; Mon, 7 Jun 2010 01:49:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o571iMON099663; Sun, 6 Jun 2010 19:44:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 06 Jun 2010 19:44:30 -0600 (MDT) Message-Id: <20100606.194430.242248466057854597.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: References: <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-projects@FreeBSD.org, xcllnt@mac.com, nwhitehorn@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208850 - projects/ppc64/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 01:49:25 -0000 In message: Scott Long writes: : On the specific topic of BUS_SPACE_UNRESTRICTED, that's a definition : that seems to have been "borrowed" from the bus_space API. Maybe at : one time there was a desire to marry bus_space (bus.h) and bus_dma : together in some fashion, but I don't see that having any practical : value now. bus_dma.h and bus.h are separate interfaces and : shouldn't be sharing definitions, as far as I'm concerned. If there : are any disagreements on this, I'm happy to hear them. busdma started out life as being dependent on bus_space. Today, it still depends on bus_addr_t and bus_size_t, etc. BUS_SPACE_UNRESTRICTED appears to have only ever been used by bus_dma, and never by bus_space itself. In fact, the whole family of BUS_SPACE_MAX{SIZE,ADDR}_{24,32}BIT appear to be MI as well. And BUS_SPACE_MAXSIZE is defined wrong for at least amd64.... Warner From owner-svn-src-projects@FreeBSD.ORG Mon Jun 7 03:08:52 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B540E106567C; Mon, 7 Jun 2010 03:08:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A65B88FC14; Mon, 7 Jun 2010 03:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5738qEj037013; Mon, 7 Jun 2010 03:08:52 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5738qgp037011; Mon, 7 Jun 2010 03:08:52 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006070308.o5738qgp037011@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Jun 2010 03:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208882 - projects/altix/sys/dev/usb X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 03:08:52 -0000 Author: marcel Date: Mon Jun 7 03:08:52 2010 New Revision: 208882 URL: http://svn.freebsd.org/changeset/base/208882 Log: Don't call bus_dmamap_sync() with a NULL dmamap. Modified: projects/altix/sys/dev/usb/usb_busdma.c Modified: projects/altix/sys/dev/usb/usb_busdma.c ============================================================================== --- projects/altix/sys/dev/usb/usb_busdma.c Sun Jun 6 22:27:32 2010 (r208881) +++ projects/altix/sys/dev/usb/usb_busdma.c Mon Jun 7 03:08:52 2010 (r208882) @@ -675,7 +675,7 @@ usb_pc_load_mem(struct usb_page_cache *p void usb_pc_cpu_invalidate(struct usb_page_cache *pc) { - if (pc->page_offset_end == pc->page_offset_buf) { + if (pc->page_offset_end == pc->page_offset_buf || pc->map == NULL) { /* nothing has been loaded into this page cache! */ return; } @@ -695,7 +695,7 @@ usb_pc_cpu_invalidate(struct usb_page_ca void usb_pc_cpu_flush(struct usb_page_cache *pc) { - if (pc->page_offset_end == pc->page_offset_buf) { + if (pc->page_offset_end == pc->page_offset_buf || pc->map == NULL) { /* nothing has been loaded into this page cache! */ return; } From owner-svn-src-projects@FreeBSD.ORG Mon Jun 7 04:45:41 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9FF1065670; Mon, 7 Jun 2010 04:45:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2648FC08; Mon, 7 Jun 2010 04:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o574je3Z059044; Mon, 7 Jun 2010 04:45:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o574jeUs059041; Mon, 7 Jun 2010 04:45:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006070445.o574jeUs059041@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Jun 2010 04:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208884 - in projects/altix/sys: amd64/include i386/i386 i386/include kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 04:45:41 -0000 Author: marcel Date: Mon Jun 7 04:45:40 2010 New Revision: 208884 URL: http://svn.freebsd.org/changeset/base/208884 Log: o bus_dmamap_sync() and bus_dmamap_unload() are getting called with a NULL map quite commonly, so test for it and print a warning. This was previously done in sys/bus_dma.h by macro expansion, but such makes a poor KPI. I'd rather fix the drivers. o Port i386 to busdma/mi. Modified: projects/altix/sys/amd64/include/bus_dma.h projects/altix/sys/i386/i386/busdma_machdep.c projects/altix/sys/i386/include/bus_dma.h projects/altix/sys/kern/subr_busdma.c Modified: projects/altix/sys/amd64/include/bus_dma.h ============================================================================== --- projects/altix/sys/amd64/include/bus_dma.h Mon Jun 7 04:01:38 2010 (r208883) +++ projects/altix/sys/amd64/include/bus_dma.h Mon Jun 7 04:45:40 2010 (r208884) @@ -31,6 +31,8 @@ #include +#define BUSDMA_MAX_BPAGES 8192 + #define bus_dma_tag_parent(x) x #endif /* _AMD64_BUS_DMA_H_ */ Modified: projects/altix/sys/i386/i386/busdma_machdep.c ============================================================================== --- projects/altix/sys/i386/i386/busdma_machdep.c Mon Jun 7 04:01:38 2010 (r208883) +++ projects/altix/sys/i386/i386/busdma_machdep.c Mon Jun 7 04:45:40 2010 (r208884) @@ -26,1191 +26,3 @@ #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 - -#define MAX_BPAGES 512 -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 - -struct bounce_zone; - -struct bus_dma_tag { - bus_dma_tag_t parent; - bus_size_t alignment; - bus_size_t boundary; - bus_addr_t lowaddr; - bus_addr_t highaddr; - bus_dma_filter_t *filter; - void *filterarg; - bus_size_t maxsize; - u_int nsegments; - bus_size_t maxsegsz; - int flags; - int ref_count; - int map_count; - bus_dma_lock_t *lockfunc; - void *lockfuncarg; - bus_dma_segment_t *segments; - struct bounce_zone *bounce_zone; -}; - -struct bounce_page { - vm_offset_t vaddr; /* kva of bounce buffer */ - bus_addr_t busaddr; /* Physical address */ - vm_offset_t datavaddr; /* kva of client data */ - bus_size_t datacount; /* client data count */ - STAILQ_ENTRY(bounce_page) links; -}; - -int busdma_swi_pending; - -struct bounce_zone { - STAILQ_ENTRY(bounce_zone) links; - STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; - int total_bpages; - int free_bpages; - int reserved_bpages; - int active_bpages; - int total_bounced; - int total_deferred; - int map_count; - bus_size_t alignment; - bus_addr_t lowaddr; - char zoneid[8]; - char lowaddrid[20]; - struct sysctl_ctx_list sysctl_tree; - struct sysctl_oid *sysctl_tree_top; -}; - -static struct mtx bounce_lock; -static int total_bpages; -static int busdma_zonecount; -static STAILQ_HEAD(, bounce_zone) bounce_zone_list; - -SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); -SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, - "Total bounce pages"); - -struct bus_dmamap { - struct bp_list bpages; - int pagesneeded; - int pagesreserved; - bus_dma_tag_t dmat; - void *buf; /* unmapped buffer pointer */ - bus_size_t buflen; /* unmapped buffer length */ - bus_dmamap_callback_t *callback; - void *callback_arg; - STAILQ_ENTRY(bus_dmamap) links; -}; - -static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; -static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static struct bus_dmamap nobounce_dmamap; - -static void init_bounce_pages(void *dummy); -static int alloc_bounce_zone(bus_dma_tag_t dmat); -static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); -static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int commit); -static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_size_t size); -static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); -int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, - void *buf, bus_size_t buflen, int flags); - -#ifdef XEN -#undef pmap_kextract -#define pmap_kextract pmap_kextract_ma -#endif - -/* - * Return true if a match is made. - * - * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. - * - * If paddr is within the bounds of the dma tag then call the filter callback - * to check for a match, if there is no filter callback then assume a match. - */ -int -run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) -{ - int retval; - - retval = 0; - - do { - if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0)) - && (dmat->filter == NULL - || (*dmat->filter)(dmat->filterarg, paddr) != 0)) - retval = 1; - - dmat = dmat->parent; - } while (retval == 0 && dmat != NULL); - return (retval); -} - -/* - * Convenience function for manipulating driver locks from busdma (during - * busdma_swi, for example). Drivers that don't provide their own locks - * should specify &Giant to dmat->lockfuncarg. Drivers that use their own - * non-mutex locking scheme don't have to use this at all. - */ -void -busdma_lock_mutex(void *arg, bus_dma_lock_op_t op) -{ - struct mtx *dmtx; - - dmtx = (struct mtx *)arg; - switch (op) { - case BUS_DMA_LOCK: - mtx_lock(dmtx); - break; - case BUS_DMA_UNLOCK: - mtx_unlock(dmtx); - break; - default: - panic("Unknown operation 0x%x for busdma_lock_mutex!", op); - } -} - -/* - * dflt_lock should never get called. It gets put into the dma tag when - * lockfunc == NULL, which is only valid if the maps that are associated - * with the tag are meant to never be defered. - * XXX Should have a way to identify which driver is responsible here. - */ -static void -dflt_lock(void *arg, bus_dma_lock_op_t op) -{ - panic("driver error: busdma dflt_lock called"); -} - -/* - * Allocate a device specific dma_tag. - */ -int -bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, - bus_size_t boundary, bus_addr_t lowaddr, - bus_addr_t highaddr, bus_dma_filter_t *filter, - void *filterarg, bus_size_t maxsize, int nsegments, - bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, - void *lockfuncarg, bus_dma_tag_t *dmat) -{ - bus_dma_tag_t newtag; - int error = 0; - - /* Basic sanity checking */ - if (boundary != 0 && boundary < maxsegsz) - maxsegsz = boundary; - - if (maxsegsz == 0) { - return (EINVAL); - } - - /* Return a NULL tag on failure */ - *dmat = NULL; - - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, - M_ZERO | M_NOWAIT); - if (newtag == NULL) { - CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, 0, error); - return (ENOMEM); - } - - newtag->parent = parent; - newtag->alignment = alignment; - newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + - (PAGE_SIZE - 1); - newtag->filter = filter; - newtag->filterarg = filterarg; - newtag->maxsize = maxsize; - newtag->nsegments = nsegments; - newtag->maxsegsz = maxsegsz; - newtag->flags = flags; - newtag->ref_count = 1; /* Count ourself */ - newtag->map_count = 0; - if (lockfunc != NULL) { - newtag->lockfunc = lockfunc; - newtag->lockfuncarg = lockfuncarg; - } else { - newtag->lockfunc = dflt_lock; - newtag->lockfuncarg = NULL; - } - newtag->segments = NULL; - - /* Take into account any restrictions imposed by our parent tag */ - if (parent != NULL) { - newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); - if (newtag->boundary == 0) - newtag->boundary = parent->boundary; - else if (parent->boundary != 0) - newtag->boundary = MIN(parent->boundary, - newtag->boundary); - if ((newtag->filter != NULL) || - ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) - newtag->flags |= BUS_DMA_COULD_BOUNCE; - if (newtag->filter == NULL) { - /* - * Short circuit looking at our parent directly - * since we have encapsulated all of its information - */ - newtag->filter = parent->filter; - newtag->filterarg = parent->filterarg; - newtag->parent = parent->parent; - } - if (newtag->parent != NULL) - atomic_add_int(&parent->ref_count, 1); - } - - if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) - || newtag->alignment > 1) - newtag->flags |= BUS_DMA_COULD_BOUNCE; - - if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && - (flags & BUS_DMA_ALLOCNOW) != 0) { - struct bounce_zone *bz; - - /* Must bounce */ - - if ((error = alloc_bounce_zone(newtag)) != 0) { - free(newtag, M_DEVBUF); - return (error); - } - bz = newtag->bounce_zone; - - if (ptoa(bz->total_bpages) < maxsize) { - int pages; - - pages = atop(maxsize) - bz->total_bpages; - - /* Add pages to our bounce pool */ - if (alloc_bounce_pages(newtag, pages) < pages) - error = ENOMEM; - } - /* Performed initial allocation */ - newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; - } - - if (error != 0) { - free(newtag, M_DEVBUF); - } else { - *dmat = newtag; - } - CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); - return (error); -} - -int -bus_dma_tag_destroy(bus_dma_tag_t dmat) -{ - bus_dma_tag_t dmat_copy; - int error; - - error = 0; - dmat_copy = dmat; - - if (dmat != NULL) { - - if (dmat->map_count != 0) { - error = EBUSY; - goto out; - } - - while (dmat != NULL) { - bus_dma_tag_t parent; - - parent = dmat->parent; - atomic_subtract_int(&dmat->ref_count, 1); - if (dmat->ref_count == 0) { - if (dmat->segments != NULL) - free(dmat->segments, M_DEVBUF); - free(dmat, M_DEVBUF); - /* - * Last reference count, so - * release our reference - * count on our parent. - */ - dmat = parent; - } else - dmat = NULL; - } - } -out: - CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); - return (error); -} - -/* - * Allocate a handle for mapping from kva/uva/physical - * address space into bus device space. - */ -int -bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) -{ - int error; - - error = 0; - - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - M_NOWAIT); - if (dmat->segments == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } - } - - /* - * Bouncing might be required if the driver asks for an active - * exclusion region, a data alignment that is stricter than 1, and/or - * an active address boundary. - */ - if (dmat->flags & BUS_DMA_COULD_BOUNCE) { - - /* Must bounce */ - struct bounce_zone *bz; - int maxpages; - - if (dmat->bounce_zone == NULL) { - if ((error = alloc_bounce_zone(dmat)) != 0) - return (error); - } - bz = dmat->bounce_zone; - - *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (*mapp == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } - - /* Initialize the new map */ - STAILQ_INIT(&((*mapp)->bpages)); - - /* - * Attempt to add pages to our pool on a per-instance - * basis up to a sane limit. - */ - if (dmat->alignment > 1) - maxpages = MAX_BPAGES; - else - maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); - if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (bz->map_count > 0 && bz->total_bpages < maxpages)) { - int pages; - - pages = MAX(atop(dmat->maxsize), 1); - pages = MIN(maxpages - bz->total_bpages, pages); - pages = MAX(pages, 1); - if (alloc_bounce_pages(dmat, pages) < pages) - error = ENOMEM; - - if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { - if (error == 0) - dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; - } else { - error = 0; - } - } - bz->map_count++; - } else { - *mapp = NULL; - } - if (error == 0) - dmat->map_count++; - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, error); - return (error); -} - -/* - * Destroy a handle for mapping from kva/uva/physical - * address space into bus device space. - */ -int -bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) -{ - if (map != NULL && map != &nobounce_dmamap) { - if (STAILQ_FIRST(&map->bpages) != NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, EBUSY); - return (EBUSY); - } - if (dmat->bounce_zone) - dmat->bounce_zone->map_count--; - free(map, M_DEVBUF); - } - dmat->map_count--; - CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); - return (0); -} - - -/* - * Allocate a piece of memory that can be efficiently mapped into - * bus device space based on the constraints lited in the dma tag. - * A dmamap to for use with dmamap_load is also allocated. - */ -int -bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, - bus_dmamap_t *mapp) -{ - int mflags; - - if (flags & BUS_DMA_NOWAIT) - mflags = M_NOWAIT; - else - mflags = M_WAITOK; - - /* If we succeed, no mapping/bouncing will be required */ - *mapp = NULL; - - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - mflags); - if (dmat->segments == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - return (ENOMEM); - } - } - if (flags & BUS_DMA_ZERO) - mflags |= M_ZERO; - - /* - * XXX: - * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact - * alignment guarantees of malloc need to be nailed down, and the - * code below should be rewritten to take that into account. - * - * In the meantime, we'll warn the user if malloc gets it wrong. - */ - if ((dmat->maxsize <= PAGE_SIZE) && - (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { - *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); - } else { - /* - * XXX Use Contigmalloc until it is merged into this facility - * and handles multi-seg allocations. Nobody is doing - * multi-seg allocations yet though. - * XXX Certain AGP hardware does. - */ - *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, - 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, - dmat->boundary); - } - if (*vaddr == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - return (ENOMEM); - } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { - printf("bus_dmamem_alloc failed to align memory properly.\n"); - } - if (flags & BUS_DMA_NOCACHE) - pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, - PAT_UNCACHEABLE); - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, 0); - return (0); -} - -/* - * Free a piece of memory and it's allociated dmamap, that was allocated - * via bus_dmamem_alloc. Make the same choice for free/contigfree. - */ -void -bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) -{ - /* - * dmamem does not need to be bounced, so the map should be - * NULL - */ - if (map != NULL) - panic("bus_dmamem_free: Invalid map freed\n"); - pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK); - if ((dmat->maxsize <= PAGE_SIZE) && - (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) - free(vaddr, M_DEVBUF); - else { - contigfree(vaddr, dmat->maxsize, M_DEVBUF); - } - CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); -} - -int -_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, - void *buf, bus_size_t buflen, int flags) -{ - vm_offset_t vaddr; - vm_offset_t vendaddr; - bus_addr_t paddr; - - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { - CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " - "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), - dmat->boundary, dmat->alignment); - CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", - map, &nobounce_dmamap, map->pagesneeded); - /* - * Count the number of bounce pages - * needed in order to complete this transfer - */ - vaddr = (vm_offset_t)buf; - vendaddr = (vm_offset_t)buf + buflen; - - while (vaddr < vendaddr) { - if (pmap) - paddr = pmap_extract(pmap, vaddr); - else - paddr = pmap_kextract(vaddr); - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - run_filter(dmat, paddr) != 0) { - map->pagesneeded++; - } - vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); - } - CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); - } - - /* Reserve Necessary Bounce Pages */ - if (map->pagesneeded != 0) { - mtx_lock(&bounce_lock); - if (flags & BUS_DMA_NOWAIT) { - if (reserve_bounce_pages(dmat, map, 0) != 0) { - mtx_unlock(&bounce_lock); - return (ENOMEM); - } - } else { - if (reserve_bounce_pages(dmat, map, 1) != 0) { - /* Queue us for resources */ - map->dmat = dmat; - map->buf = buf; - map->buflen = buflen; - STAILQ_INSERT_TAIL(&bounce_map_waitinglist, - map, links); - mtx_unlock(&bounce_lock); - return (EINPROGRESS); - } - } - mtx_unlock(&bounce_lock); - } - - return (0); -} - -/* - * Utility function to load a linear buffer. lastaddrp holds state - * between invocations (for multiple-buffer loads). segp contains - * the starting segment on entrace, and the ending segment on exit. - * first indicates if this is the first invocation of this function. - */ -static __inline int -_bus_dmamap_load_buffer(bus_dma_tag_t dmat, - bus_dmamap_t map, - void *buf, bus_size_t buflen, - pmap_t pmap, - int flags, - bus_addr_t *lastaddrp, - bus_dma_segment_t *segs, - int *segp, - int first) -{ - bus_size_t sgsize; - bus_addr_t curaddr, lastaddr, baddr, bmask; - vm_offset_t vaddr; - int seg, error; - - if (map == NULL) - map = &nobounce_dmamap; - - if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { - error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); - if (error) - return (error); - } - - vaddr = (vm_offset_t)buf; - lastaddr = *lastaddrp; - bmask = ~(dmat->boundary - 1); - - for (seg = *segp; buflen > 0 ; ) { - /* - * Get the physical address for this segment. - */ - if (pmap) - curaddr = pmap_extract(pmap, vaddr); - else - curaddr = pmap_kextract(vaddr); - - /* - * Compute the segment size, and adjust counts. - */ - sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); - if (sgsize > dmat->maxsegsz) - sgsize = dmat->maxsegsz; - if (buflen < sgsize) - sgsize = buflen; - - /* - * Make sure we don't cross any boundaries. - */ - if (dmat->boundary > 0) { - baddr = (curaddr + dmat->boundary) & bmask; - if (sgsize > (baddr - curaddr)) - sgsize = (baddr - curaddr); - } - - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && run_filter(dmat, curaddr)) - curaddr = add_bounce_page(dmat, map, vaddr, sgsize); - - /* - * Insert chunk into a segment, coalescing with - * previous segment if possible. - */ - if (first) { - segs[seg].ds_addr = curaddr; - segs[seg].ds_len = sgsize; - first = 0; - } else { - if (curaddr == lastaddr && - (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && - (dmat->boundary == 0 || - (segs[seg].ds_addr & bmask) == (curaddr & bmask))) - segs[seg].ds_len += sgsize; - else { - if (++seg >= dmat->nsegments) - break; - segs[seg].ds_addr = curaddr; - segs[seg].ds_len = sgsize; - } - } - - lastaddr = curaddr + sgsize; - vaddr += sgsize; - buflen -= sgsize; - } - - *segp = seg; - *lastaddrp = lastaddr; - - /* - * Did we fit? - */ - return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ -} - -/* - * Map the buffer buf into bus space using the dmamap map. - */ -int -bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, bus_dmamap_callback_t *callback, - void *callback_arg, int flags) -{ - bus_addr_t lastaddr = 0; - int error, nsegs = 0; - - if (map != NULL) { - flags |= BUS_DMA_WAITOK; - map->callback = callback; - map->callback_arg = callback_arg; - } - - error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, - &lastaddr, dmat->segments, &nsegs, 1); - - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); - - if (error == EINPROGRESS) { - return (error); - } - - if (error) - (*callback)(callback_arg, dmat->segments, 0, error); - else - (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); - - /* - * Return ENOMEM to the caller so that it can pass it up the stack. - * This error only happens when NOWAIT is set, so deferal is disabled. - */ - if (error == ENOMEM) - return (error); - - return (0); -} - - -/* - * Like _bus_dmamap_load(), but for mbufs. - */ -static __inline int -_bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, - int flags) -{ - int error; - - M_ASSERTPKTHDR(m0); - - flags |= BUS_DMA_NOWAIT; - *nsegs = 0; - error = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { - int first = 1; - bus_addr_t lastaddr = 0; - struct mbuf *m; - - for (m = m0; m != NULL && error == 0; m = m->m_next) { - if (m->m_len > 0) { - error = _bus_dmamap_load_buffer(dmat, map, - m->m_data, m->m_len, - NULL, flags, &lastaddr, - segs, nsegs, first); - first = 0; - } - } - } else { - error = EINVAL; - } - - /* XXX FIXME: Having to increment nsegs is really annoying */ - ++*nsegs; - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, *nsegs); - return (error); -} - -int -bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) -{ - int nsegs, error; - - error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, dmat->segments, &nsegs, - flags); - - if (error) { - /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); - } else { - (*callback)(callback_arg, dmat->segments, - nsegs, m0->m_pkthdr.len, error); - } - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs); - return (error); -} - -int -bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, - int flags) -{ - return (_bus_dmamap_load_mbuf_sg(dmat, map, m0, segs, nsegs, flags)); -} - -/* - * Like _bus_dmamap_load(), but for uios. - */ -int -bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, - struct uio *uio, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) -{ - bus_addr_t lastaddr; - int nsegs, error, first, i; - bus_size_t resid; - struct iovec *iov; - pmap_t pmap; - - flags |= BUS_DMA_NOWAIT; - resid = uio->uio_resid; - iov = uio->uio_iov; - - if (uio->uio_segflg == UIO_USERSPACE) { - KASSERT(uio->uio_td != NULL, - ("bus_dmamap_load_uio: USERSPACE but no proc")); - pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); - } else - pmap = NULL; - - nsegs = 0; - error = 0; - first = 1; - lastaddr = (bus_addr_t) 0; - for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { - /* - * Now at the first iovec to load. Load each iovec - * until we have exhausted the residual count. - */ - bus_size_t minlen = - resid < iov[i].iov_len ? resid : iov[i].iov_len; - caddr_t addr = (caddr_t) iov[i].iov_base; - - if (minlen > 0) { - error = _bus_dmamap_load_buffer(dmat, map, - addr, minlen, pmap, flags, &lastaddr, - dmat->segments, &nsegs, first); - first = 0; - - resid -= minlen; - } - } - - if (error) { - /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); - } else { - (*callback)(callback_arg, dmat->segments, - nsegs+1, uio->uio_resid, error); - } - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); - return (error); -} - -/* - * Release the mapping held by map. - */ -void -_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) -{ - struct bounce_page *bpage; - - while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { - STAILQ_REMOVE_HEAD(&map->bpages, links); - free_bounce_page(dmat, bpage); - } -} - -void -_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) -{ - struct bounce_page *bpage; - - if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { - /* - * Handle data bouncing. We might also - * want to add support for invalidating - * the caches on broken hardware - */ - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " - "performing bounce", __func__, op, dmat, dmat->flags); - - if (op & BUS_DMASYNC_PREWRITE) { - while (bpage != NULL) { - bcopy((void *)bpage->datavaddr, - (void *)bpage->vaddr, - bpage->datacount); - bpage = STAILQ_NEXT(bpage, links); - } - dmat->bounce_zone->total_bounced++; - } - - if (op & BUS_DMASYNC_POSTREAD) { - while (bpage != NULL) { - bcopy((void *)bpage->vaddr, - (void *)bpage->datavaddr, - bpage->datacount); - bpage = STAILQ_NEXT(bpage, links); - } - dmat->bounce_zone->total_bounced++; - } - } -} - -static void -init_bounce_pages(void *dummy __unused) -{ - - total_bpages = 0; - STAILQ_INIT(&bounce_zone_list); - STAILQ_INIT(&bounce_map_waitinglist); - STAILQ_INIT(&bounce_map_callbacklist); - mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF); -} -SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL); - -static struct sysctl_ctx_list * -busdma_sysctl_tree(struct bounce_zone *bz) -{ - return (&bz->sysctl_tree); -} - -static struct sysctl_oid * -busdma_sysctl_tree_top(struct bounce_zone *bz) -{ - return (bz->sysctl_tree_top); -} - -static int -alloc_bounce_zone(bus_dma_tag_t dmat) -{ - struct bounce_zone *bz; - - /* Check to see if we already have a suitable zone */ - STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->alignment <= bz->alignment) - && (dmat->lowaddr >= bz->lowaddr)) { - dmat->bounce_zone = bz; - return (0); - } - } - - if ((bz = (struct bounce_zone *)malloc(sizeof(*bz), M_DEVBUF, - M_NOWAIT | M_ZERO)) == NULL) - return (ENOMEM); - - STAILQ_INIT(&bz->bounce_page_list); - bz->free_bpages = 0; - bz->reserved_bpages = 0; - bz->active_bpages = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Jun 8 07:49:03 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56AB3106567E; Tue, 8 Jun 2010 07:49:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444218FC18; Tue, 8 Jun 2010 07:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o587n3lv033918; Tue, 8 Jun 2010 07:49:03 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o587n3nX033901; Tue, 8 Jun 2010 07:49:03 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201006080749.o587n3nX033901@svn.freebsd.org> From: Jeff Roberson Date: Tue, 8 Jun 2010 07:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208906 - in projects/ofed/head/sys/ofed/include: asm linux net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 07:49:03 -0000 Author: jeff Date: Tue Jun 8 07:49:02 2010 New Revision: 208906 URL: http://svn.freebsd.org/changeset/base/208906 Log: Import initial linux KPI compat code inspired by Luigi's kmod compat port. - Define linux bits using the same headers as linux uses for maximum include compatibility. The same include nesting is used where possible. - Some files are empty as nothing from them was required to build ofed. - Some implementations are still stubs (file, device, idr, dma-mapping). Sponsored by: Isilon Systems, iX Systems, and Panasas. Added: projects/ofed/head/sys/ofed/include/asm/ projects/ofed/head/sys/ofed/include/asm/atomic-long.h projects/ofed/head/sys/ofed/include/asm/atomic.h projects/ofed/head/sys/ofed/include/asm/byteorder.h projects/ofed/head/sys/ofed/include/asm/current.h projects/ofed/head/sys/ofed/include/asm/fcntl.h projects/ofed/head/sys/ofed/include/asm/semaphore.h projects/ofed/head/sys/ofed/include/asm/system.h projects/ofed/head/sys/ofed/include/asm/types.h projects/ofed/head/sys/ofed/include/asm/uaccess.h projects/ofed/head/sys/ofed/include/linux/bitmap.h projects/ofed/head/sys/ofed/include/linux/bitops.h projects/ofed/head/sys/ofed/include/linux/cdev.h projects/ofed/head/sys/ofed/include/linux/compat.h projects/ofed/head/sys/ofed/include/linux/compiler.h projects/ofed/head/sys/ofed/include/linux/completion.h projects/ofed/head/sys/ofed/include/linux/ctype.h projects/ofed/head/sys/ofed/include/linux/device.h projects/ofed/head/sys/ofed/include/linux/dma-attrs.h projects/ofed/head/sys/ofed/include/linux/dma-mapping.h projects/ofed/head/sys/ofed/include/linux/err.h projects/ofed/head/sys/ofed/include/linux/errno.h projects/ofed/head/sys/ofed/include/linux/ethtool.h projects/ofed/head/sys/ofed/include/linux/file.h projects/ofed/head/sys/ofed/include/linux/fs.h projects/ofed/head/sys/ofed/include/linux/gfp.h projects/ofed/head/sys/ofed/include/linux/idr.h projects/ofed/head/sys/ofed/include/linux/if_arp.h projects/ofed/head/sys/ofed/include/linux/if_ether.h projects/ofed/head/sys/ofed/include/linux/if_vlan.h projects/ofed/head/sys/ofed/include/linux/in.h projects/ofed/head/sys/ofed/include/linux/in6.h projects/ofed/head/sys/ofed/include/linux/inetdevice.h projects/ofed/head/sys/ofed/include/linux/init.h projects/ofed/head/sys/ofed/include/linux/interrupt.h projects/ofed/head/sys/ofed/include/linux/ioctl.h projects/ofed/head/sys/ofed/include/linux/jhash.h projects/ofed/head/sys/ofed/include/linux/jiffies.h projects/ofed/head/sys/ofed/include/linux/kdev_t.h projects/ofed/head/sys/ofed/include/linux/kernel.h projects/ofed/head/sys/ofed/include/linux/kobject.h projects/ofed/head/sys/ofed/include/linux/kref.h projects/ofed/head/sys/ofed/include/linux/kthread.h projects/ofed/head/sys/ofed/include/linux/list.h projects/ofed/head/sys/ofed/include/linux/lockdep.h projects/ofed/head/sys/ofed/include/linux/miscdevice.h projects/ofed/head/sys/ofed/include/linux/mm.h projects/ofed/head/sys/ofed/include/linux/module.h projects/ofed/head/sys/ofed/include/linux/moduleparam.h projects/ofed/head/sys/ofed/include/linux/mount.h projects/ofed/head/sys/ofed/include/linux/mutex.h projects/ofed/head/sys/ofed/include/linux/netdevice.h projects/ofed/head/sys/ofed/include/linux/page.h projects/ofed/head/sys/ofed/include/linux/pci.h projects/ofed/head/sys/ofed/include/linux/poll.h projects/ofed/head/sys/ofed/include/linux/random.h projects/ofed/head/sys/ofed/include/linux/rbtree.h projects/ofed/head/sys/ofed/include/linux/rwlock.h projects/ofed/head/sys/ofed/include/linux/rwsem.h projects/ofed/head/sys/ofed/include/linux/scatterlist.h projects/ofed/head/sys/ofed/include/linux/sched.h projects/ofed/head/sys/ofed/include/linux/semaphore.h projects/ofed/head/sys/ofed/include/linux/slab.h projects/ofed/head/sys/ofed/include/linux/socket.h projects/ofed/head/sys/ofed/include/linux/spinlock.h projects/ofed/head/sys/ofed/include/linux/stddef.h projects/ofed/head/sys/ofed/include/linux/string.h projects/ofed/head/sys/ofed/include/linux/sysfs.h projects/ofed/head/sys/ofed/include/linux/timer.h projects/ofed/head/sys/ofed/include/linux/types.h projects/ofed/head/sys/ofed/include/linux/uaccess.h projects/ofed/head/sys/ofed/include/linux/wait.h projects/ofed/head/sys/ofed/include/linux/workqueue.h projects/ofed/head/sys/ofed/include/net/ projects/ofed/head/sys/ofed/include/net/addrconf.h projects/ofed/head/sys/ofed/include/net/arp.h projects/ofed/head/sys/ofed/include/net/ip6_route.h projects/ofed/head/sys/ofed/include/net/ipv6.h projects/ofed/head/sys/ofed/include/net/neighbour.h projects/ofed/head/sys/ofed/include/net/netevent.h projects/ofed/head/sys/ofed/include/net/route.h projects/ofed/head/sys/ofed/include/net/tcp.h Added: projects/ofed/head/sys/ofed/include/asm/atomic-long.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/atomic-long.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,79 @@ +*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _ATOMIC_LONG_H_ +#define _ATOMIC_LONG_H_ + +#include +#include +#include + +typedef struct { + volatile u_long counter; +} atomic_long_t; + +#define atomic_long_add(i, v) atomic_long_add_return((i), (v)) +#define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) + +static inline u_long +atomic_long_add_return(long i, atomic_long_t *v) +{ + return i + atomic_fetchadd_long(&v->counter, i); +} + +static inline void +atomic_long_set(atomic_long_t *v, long i) +{ + atomic_set_long(&v->counter, i); +} + +static inline long +atomic_long_read(atomic_long_t *v) +{ + return atomic_load_acq_long(&v->counter); +} + +static inline long +atomic_long_inc(atomic_long_t *v) +{ + return atomic_fetchadd_long(&v->counter, 1) + 1; +} + +static inline long +atomic_long_dec(atomic_long_t *v) +{ + return atomic_fetchadd_long(&v->counter, -1) - 1; +} + +static inline__ long +atomic_long_dec_and_test(atomic_long_t *v) +{ + long i = atomic_long_add(-1, v); + return i == 0 ; +} + +#endif /* _ATOMIC_LONG_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/atomic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/atomic.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _ASM_ATOMIC_H_ +#define _ASM_ATOMIC_H_ + +#include +#include +#include +#include + +typedef struct { + volatile u_int counter; +} atomic_t; + +#define atomic_add(i, v) atomic_add_return((i), (v)) +#define atomic_sub(i, v) atomic_sub_return((i), (v)) +#define atomic_inc_return(v) atomic_add_return(1, (v)) +#define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) +#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) +#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) + +static inline u_int +atomic_add_return(int i, atomic_t *v) +{ + return i + atomic_fetchadd_int(&v->counter, i); +} + +static inline u_int +atomic_sub_return(int i, atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, -i) - i; +} + +static inline void +atomic_set(atomic_t *v, int i) +{ + atomic_set_int(&v->counter, i); +} + +static inline int +atomic_read(atomic_t *v) +{ + return atomic_load_acq_int(&v->counter); +} + +static inline int +atomic_inc(atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, 1) + 1; +} + +static inline int +atomic_dec(atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, -1) - 1; +} + +#endif /* _ASM_ATOMIC_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/byteorder.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/byteorder.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _ASM_BYTEORDER_H_ +#define _ASM_BYTEORDER_H_ + +#include +#include + +#define cpu_to_le64 htole64 +#define le64_to_cpu le64toh +#define cpu_to_le32 htole32 +#define le32_to_cpu le32toh +#define cpu_to_le16 htole16 +#define le16_to_cpu le16toh +#define cpu_to_be64 htobe64 +#define be64_to_cpu be64toh +#define cpu_to_be32 htobe32 +#define be32_to_cpu be32toh +#define cpu_to_be16 htobe16 +#define be16_to_cpu be16toh +#define __be16_to_cpu be16toh + +#define cpu_to_le64p(x) htole64(*(x)) +#define le64_to_cpup(x) le64toh(*(x)) +#define cpu_to_le32p(x) htole32(*(x)) +#define le32_to_cpup(x) le32toh(*(x)) +#define cpu_to_le16p(x) htole16(*(x)) +#define le16_to_cpup(x) le16toh(*(x)) +#define cpu_to_be64p(x) htobe64(*(x)) +#define be64_to_cpup(x) be64toh(*(x)) +#define cpu_to_be32p(x) htobe32(*(x)) +#define be32_to_cpup(x) be32toh(*(x)) +#define cpu_to_be16p(x) htobe16(*(x)) +#define be16_to_cpup(x) be16toh(*(x)) + +#define cpu_to_le64s(x) do { *(x) = cpu_to_le64p((x)) } while (0) +#define le64_to_cpus(x) do { *(x) = le64_to_cpup((x)) } while (0) +#define cpu_to_le32s(x) do { *(x) = cpu_to_le32p((x)) } while (0) +#define le32_to_cpus(x) do { *(x) = le32_to_cpup((x)) } while (0) +#define cpu_to_le16s(x) do { *(x) = cpu_to_le16p((x)) } while (0) +#define le16_to_cpus(x) do { *(x) = le16_to_cpup((x)) } while (0) +#define cpu_to_be64s(x) do { *(x) = cpu_to_be64p((x)) } while (0) +#define be64_to_cpus(x) do { *(x) = be64_to_cpup((x)) } while (0) +#define cpu_to_be32s(x) do { *(x) = cpu_to_be32p((x)) } while (0) +#define be32_to_cpus(x) do { *(x) = be32_to_cpup((x)) } while (0) +#define cpu_to_be16s(x) do { *(x) = cpu_to_be16p((x)) } while (0) +#define be16_to_cpus(x) do { *(x) = be16_to_cpup((x)) } while (0) + +#endif /* _ASM_BYTEORDER_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/current.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/current.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _ASM_CURRENT_H_ +#define _ASM_CURRENT_H_ + +#endif /* _ASM_CURRENT_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/fcntl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/fcntl.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _ASM_FCNTL_H_ +#define _ASM_FCNTL_H_ + +#include + +#endif /* _ASM_FCNTL_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/semaphore.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/semaphore.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _ASM_SEMAPHORE_H_ +#define _ASM_SEMAPHORE_H_ + +#include + +#endif /* _ASM_SEMAPHORE_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/system.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/system.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,27 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ Added: projects/ofed/head/sys/ofed/include/asm/types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/types.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _ASM_TYPES_H_ +#define _ASM_TYPES_H_ + +typedef unsigned short umode_t; + +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +#if defined(__GNUC__) // && !defined(__STRICT_ANSI__) +typedef __signed__ long long __s64; +typedef unsigned long long __u64; +#endif + +#ifdef _KERNEL + +typedef signed char s8; +typedef unsigned char u8; + +typedef signed short s16; +typedef unsigned short u16; + +typedef signed int s32; +typedef unsigned int u32; + +typedef signed long long s64; +typedef unsigned long long u64; + +/* DMA addresses come in generic and 64-bit flavours. */ +typedef vm_paddr_t dma_addr_t; +typedef vm_paddr_t dma64_addr_t; + +#endif /* _KERNEL */ + +#endif /* _ASM_TYPES_H_ */ Added: projects/ofed/head/sys/ofed/include/asm/uaccess.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/asm/uaccess.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _LINUX_UACCESS_H_ +#define _LINUX_UACCESS_H_ + +#include + +long copy_from_user(void *to, const void __user * from, unsigned long n); +long copy_to_user(void __user *to, const void *from, unsigned long n); + +#endif /* _LINUX_UACCESS_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/bitmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/bitmap.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _LINUX_BITMAP_H_ +#define _LINUX_BITMAP_H_ + +#include +#include + +#endif /* _LINUX_BITMAP_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/bitops.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/bitops.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _LINUX_BITOPS_H_ +#define _LINUX_BITOPS_H_ + +#define BITS_PER_LONG (sizeof(long) * 8) +#define BIT_MASK(n) (~0UL >> (BITS_PER_LONG - (n))) +#define BITS_TO_LONGS(n) roundup2((n), BITS_PER_LONG) + +static inline unsigned long +find_first_bit(unsigned long *addr, unsigned long size) +{ + int mask; + int bit; + + for (bit = 0; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (*addr == 0) + continue; + return (bit + ffs(*addr)); + } + if (size) { + mask = (*addr) & BIT_MASK(size); + if (mask) + bit += ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline unsigned long +find_first_zero_bit(unsigned long *addr, unsigned long size) +{ + int mask; + int bit; + + for (bit = 0; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (~(*addr) == 0) + continue; + return (bit + ffs(~(*addr))); + } + if (size) { + mask = ~(*addr) & BIT_MASK(size); + if (mask) + bit += ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline unsigned long +find_last_bit(unsigned long *addr, unsigned long size) +{ + int mask; + int offs; + int bit; + int pos; + + pos = size / BITS_PER_LONG; + offs = size % BITS_PER_LONG; + bit = BITS_PER_LONG * pos; + addr += pos; + if (offs) { + mask = (*addr) & BIT_MASK(offs); + if (mask) + return (bit + flsl(mask)); + } + while (--pos) { + addr--; + bit -= BITS_PER_LONG; + if (*addr) + return (bit + flsl(mask)); + } + return (size); +} + +static inline unsigned long +find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset) +{ + int mask; + int offs; + int bit; + int pos; + + pos = offset / BITS_PER_LONG; + offs = size % BITS_PER_LONG; + bit = BITS_PER_LONG * pos; + addr += pos; + if (offs) { + mask = (*addr) & ~BIT_MASK(offs); + if (mask) + return (bit + ffsl(mask)); + bit += BITS_PER_LONG; + addr++; + } + for (size -= bit; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (*addr == 0) + continue; + return (bit + ffs(*addr)); + } + if (size) { + mask = (*addr) & BIT_MASK(size); + if (mask) + bit += ffsl(mask); + else + bit += size; + } + return (bit); +} + +#define NBINT (NBBY * sizeof(int)) + +#define set_bit(i, a) \ + atomic_set_int((volatile int *)(a)[(i)/NBINT], (i) % NBINT) + +#define clear_bit(i, a) \ + atomic_clear_int((volatile int *)(a)[(i)/NBINT], (i) % NBINT) + +#define test_bit(i, a) \ + !!(atomic_load_acq_int((volatile int *)(a)[(i)/NBINT]) & 1 << ((i) % NBINT)) + +#endif /* _LINUX_BITOPS_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/cdev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/cdev.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _LINUX_CDEV_H_ +#define _LINUX_CDEV_H_ + +#include +#include +#include + +#define cdev linux_cdev + +struct file_operations; +struct inode; +struct module; + +struct cdev { + struct kobject kobj; + struct module *owner; + dev_t dev; + const struct file_operations *ops; +}; + +void cdev_init(struct cdev *, const struct file_operations *); +struct cdev *cdev_alloc(void); +void cdev_put(struct cdev *p); +int cdev_add(struct cdev *, dev_t, unsigned); +void cdev_del(struct cdev *); + +#endif /* _LINUX_CDEV_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/compat.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _LINUX_COMPAT_H_ +#define _LINUX_COMPAT_H_ + + +#endif /* _LINUX_COMPAT_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/compiler.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/compiler.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ + +#ifndef _LINUX_COMPILER_H_ +#define _LINUX_COMPILER_H_ + +#define __user +#define __kernel +#define __safe +#define __force +#define __nocast +#define __iomem +#define __chk_user_ptr(x) 0 +#define __chk_io_ptr(x) 0 +#define __builtin_warning(x, y...) (1) +#define __acquires(x) +#define __releases(x) +#define __acquire(x) 0 +#define __release(x) 0 +#define __cond_lock(x,c) (c) +#define __bitwise +#define __devinitdata +#define __init +#define __exit +#define __stringify(x) #x +#define __attribute_const__ __attribute__((__const__)) + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#define typeof(x) __typeof(x) + +#endif /* _LINUX_COMPILER_H_ */ Added: projects/ofed/head/sys/ofed/include/linux/completion.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ofed/head/sys/ofed/include/linux/completion.h Tue Jun 8 07:49:02 2010 (r208906) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * 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 unmodified, 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 ``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 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. + */ +#ifndef _LINUX_COMPLETION_H_ +#define _LINUX_COMPLETION_H_ + +#include +#include + +#include +#include +#include +#include +#include + +struct completion { + unsigned int done; +}; + +#define INIT_COMPLETION(c) ((c).done = 0) +#define init_completion(c) ((c)->done = 0) + +static inline void +_complete_common(struct completion *c, int all) +{ + int wakeup_swapper; + + sleepq_lock(c); + c->done++; + if (all) + wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); + else + wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); + sleepq_release(c); + if (wakeup_swapper) + kick_proc0(); +} + +#define complete(c) _complete_common(c, 0) +#define complete_all(c) _complete_common(c, 1) + +/* + * Indefinite wait for done != 0 with or without signals. + */ +static inline long +_wait_for_common(struct completion *c, int flags) +{ + + flags |= SLEEPQ_SLEEP; + for (;;) { + sleepq_lock(c); + if (c->done) { + sleepq_release(c); + break; + } + sleepq_add(c, NULL, "completion", flags, 0); + if (flags & SLEEPQ_INTERRUPTIBLE) { + if (sleepq_wait_sig(c, 0) != 0) + return (-ERESTARTSYS); + } else + sleepq_wait(c, 0); + } + c->done--; + sleepq_release(c); + + return (0); +} + +#define wait_for_completion(c) _wait_for_common(c, 0) +#define wait_for_completion_interuptible(c) \ + _wait_for_common(c, SLEEPQ_INTERRUPTIBLE) + +static inline long +_wait_for_timeout_common(struct completion *c, long timeout, int flags) +{ + long end; + + end = ticks + timeout; + flags |= SLEEPQ_SLEEP; + for (;;) { + sleepq_lock(c); + if (c->done) { + sleepq_release(c); + break; + } + sleepq_add(c, NULL, "completion", flags, 0); + sleepq_set_timeout(c, end - ticks); + if (flags & SLEEPQ_INTERRUPTIBLE) { + if (sleepq_timedwait_sig(c, 0) != 0) + return (-ERESTARTSYS); + } else + sleepq_timedwait(c, 0); + } + c->done--; + sleepq_release(c); + timeout = end - ticks; + + return (timeout > 0 ? timeout : 1); +} + +#define wait_for_completion_timeout(c, timeout) \ + _wait_for_timeout_common(c, timeout, 0) +#define wait_for_completion_interruptible_timeout(c, timeout) \ + _wait_for_timeout_common(c, timeout, SLEEPQ_INTERRUPTIBLE) + +static inline int +try_wait_for_completion(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done) + c->done--; + else + isdone = 0; + sleepq_release(c); + return (isdone); +} + +static inline int +completion_done(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done == 0) + isdone = 0; + sleepq_release(c); + return (isdone); +} + +#endif /* _LINUX_COMPLETION_H_ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Jun 8 15:45:05 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 231311065672; Tue, 8 Jun 2010 15:45:05 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1288A8FC1B; Tue, 8 Jun 2010 15:45:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Fj4jc042754; Tue, 8 Jun 2010 15:45:04 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Fj4du042753; Tue, 8 Jun 2010 15:45:04 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006081545.o58Fj4du042753@svn.freebsd.org> From: Roman Divacky Date: Tue, 8 Jun 2010 15:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208909 - projects/clangbsd-import/lib/clang X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 15:45:05 -0000 Author: rdivacky Date: Tue Jun 8 15:45:04 2010 New Revision: 208909 URL: http://svn.freebsd.org/changeset/base/208909 Log: Sort alphabetically. Modified: projects/clangbsd-import/lib/clang/clang.build.mk Modified: projects/clangbsd-import/lib/clang/clang.build.mk ============================================================================== --- projects/clangbsd-import/lib/clang/clang.build.mk Tue Jun 8 10:52:37 2010 (r208908) +++ projects/clangbsd-import/lib/clang/clang.build.mk Tue Jun 8 15:45:04 2010 (r208909) @@ -41,14 +41,6 @@ ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM . endfor .endfor -CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td - ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs \ - ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td > ${.TARGET} -CC1Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1Options.td - ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs \ - ${CLANG_SRCS}/include/clang/Driver/CC1Options.td > ${.TARGET} DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${TBLGEN} -I${CLANG_SRCS}/include/clang/Basic \ -gen-clang-diag-groups \ @@ -59,6 +51,14 @@ Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRC -gen-clang-diags-defs -clang-component=${hdr} \ ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td > ${.TARGET} .endfor +CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ + -gen-opt-parser-defs \ + ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td > ${.TARGET} +CC1Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1Options.td + ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ + -gen-opt-parser-defs \ + ${CLANG_SRCS}/include/clang/Driver/CC1Options.td > ${.TARGET} Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td ${TBLGEN} -I${CLANG_SRCS}/include/clang/Driver \ -gen-opt-parser-defs \ From owner-svn-src-projects@FreeBSD.ORG Tue Jun 8 15:45:39 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C644106567A; Tue, 8 Jun 2010 15:45:39 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1318FC08; Tue, 8 Jun 2010 15:45:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Fjdcq042917; Tue, 8 Jun 2010 15:45:39 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58FjcLn042915; Tue, 8 Jun 2010 15:45:38 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006081545.o58FjcLn042915@svn.freebsd.org> From: Roman Divacky Date: Tue, 8 Jun 2010 15:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208910 - projects/clangbsd/contrib/gcc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 15:45:39 -0000 Author: rdivacky Date: Tue Jun 8 15:45:38 2010 New Revision: 208910 URL: http://svn.freebsd.org/changeset/base/208910 Log: Remove this workaround. Clang can cope with this just fine now. Modified: projects/clangbsd/contrib/gcc/toplev.h Modified: projects/clangbsd/contrib/gcc/toplev.h ============================================================================== --- projects/clangbsd/contrib/gcc/toplev.h Tue Jun 8 15:45:04 2010 (r208909) +++ projects/clangbsd/contrib/gcc/toplev.h Tue Jun 8 15:45:38 2010 (r208910) @@ -158,7 +158,7 @@ extern int exact_log2 ( extern int floor_log2 (unsigned HOST_WIDE_INT); /* Inline versions of the above for speed. */ -#if 0 +#if GCC_VERSION >= 3004 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG # define CLZ_HWI __builtin_clzl # define CTZ_HWI __builtin_ctzl From owner-svn-src-projects@FreeBSD.ORG Tue Jun 8 15:52:32 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62AC106564A; Tue, 8 Jun 2010 15:52:32 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 86C1D8FC0A; Tue, 8 Jun 2010 15:52:32 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 84B262A28CD8; Tue, 8 Jun 2010 17:52:31 +0200 (CEST) Date: Tue, 8 Jun 2010 17:52:31 +0200 From: Ed Schouten To: Roman Divacky Message-ID: <20100608155231.GB56080@hoeg.nl> References: <201006081545.o58Fj4du042753@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ycua7eEiZ84HRBey" Content-Disposition: inline In-Reply-To: <201006081545.o58Fj4du042753@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208909 - projects/clangbsd-import/lib/clang X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 15:52:32 -0000 --ycua7eEiZ84HRBey Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky wrote: > Log: > Sort alphabetically. How is this alphabetically? C comes before D. --=20 Ed Schouten WWW: http://80386.nl/ --ycua7eEiZ84HRBey Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwOZz8ACgkQ52SDGA2eCwWGwwCeJTiRQBeyj/3GBYpoCJOLZJDz E9oAnRgb67+7W59BH1VDUUMpDzBm884l =kXYG -----END PGP SIGNATURE----- --ycua7eEiZ84HRBey-- From owner-svn-src-projects@FreeBSD.ORG Tue Jun 8 15:58:27 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F9651065752; Tue, 8 Jun 2010 15:58:27 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 57DBC8FC23; Tue, 8 Jun 2010 15:58:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D91A89CB0D0; Tue, 8 Jun 2010 17:54:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TdBVbsT6sVrR; Tue, 8 Jun 2010 17:54:42 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 90D1D9CB193; Tue, 8 Jun 2010 17:54:42 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o58FsgmI093956; Tue, 8 Jun 2010 17:54:42 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 8 Jun 2010 17:54:42 +0200 From: Roman Divacky To: Ed Schouten Message-ID: <20100608155442.GA93873@freebsd.org> References: <201006081545.o58Fj4du042753@svn.freebsd.org> <20100608155231.GB56080@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100608155231.GB56080@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208909 - projects/clangbsd-import/lib/clang X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 15:58:27 -0000 On Tue, Jun 08, 2010 at 05:52:31PM +0200, Ed Schouten wrote: > * Roman Divacky wrote: > > Log: > > Sort alphabetically. > > How is this alphabetically? C comes before D. bad commit message - sorted by the emitter and then alphabetically by the file name. From owner-svn-src-projects@FreeBSD.ORG Wed Jun 9 19:10:28 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522BB106566B; Wed, 9 Jun 2010 19:10:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41F738FC08; Wed, 9 Jun 2010 19:10:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59JAS79013878; Wed, 9 Jun 2010 19:10:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59JASJk013876; Wed, 9 Jun 2010 19:10:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006091910.o59JASJk013876@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 9 Jun 2010 19:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208960 - projects/ppc64/contrib/binutils/bfd X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:10:28 -0000 Author: nwhitehorn Date: Wed Jun 9 19:10:27 2010 New Revision: 208960 URL: http://svn.freebsd.org/changeset/base/208960 Log: Fix yet another bug in binutils 2.15 in which objcopy could segfault when making a PPC64 ELF file from something that was not an ELF file (e.g. binary input). This caused intermittent crashes while building uathload on PPC64. Reported by: Yannick Bertin, Andreas Tobler Modified: projects/ppc64/contrib/binutils/bfd/elf64-ppc.c Modified: projects/ppc64/contrib/binutils/bfd/elf64-ppc.c ============================================================================== --- projects/ppc64/contrib/binutils/bfd/elf64-ppc.c Wed Jun 9 19:09:49 2010 (r208959) +++ projects/ppc64/contrib/binutils/bfd/elf64-ppc.c Wed Jun 9 19:10:27 2010 (r208960) @@ -6033,6 +6033,10 @@ ppc64_elf_size_dynamic_sections (bfd *ou for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { + /* Skip this BFD if it is not ELF */ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + s = ppc64_elf_tdata (ibfd)->got; if (s != NULL && s != htab->got) { @@ -9000,6 +9004,10 @@ ppc64_elf_finish_dynamic_sections (bfd * while ((dynobj = dynobj->link_next) != NULL) { asection *s; + + if (bfd_get_flavour (dynobj) != bfd_target_elf_flavour) + continue; + s = ppc64_elf_tdata (dynobj)->got; if (s != NULL && s->_raw_size != 0 From owner-svn-src-projects@FreeBSD.ORG Thu Jun 10 21:52:47 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E12871065673; Thu, 10 Jun 2010 21:52:47 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF2DC8FC08; Thu, 10 Jun 2010 21:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ALqlAg075992; Thu, 10 Jun 2010 21:52:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ALqlpN075990; Thu, 10 Jun 2010 21:52:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006102152.o5ALqlpN075990@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Jun 2010 21:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209018 - projects/altix/sys/dev/usb X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 21:52:48 -0000 Author: marcel Date: Thu Jun 10 21:52:47 2010 New Revision: 209018 URL: http://svn.freebsd.org/changeset/base/209018 Log: Revert rev. 208882. Modified: projects/altix/sys/dev/usb/usb_busdma.c Modified: projects/altix/sys/dev/usb/usb_busdma.c ============================================================================== --- projects/altix/sys/dev/usb/usb_busdma.c Thu Jun 10 20:59:28 2010 (r209017) +++ projects/altix/sys/dev/usb/usb_busdma.c Thu Jun 10 21:52:47 2010 (r209018) @@ -675,7 +675,7 @@ usb_pc_load_mem(struct usb_page_cache *p void usb_pc_cpu_invalidate(struct usb_page_cache *pc) { - if (pc->page_offset_end == pc->page_offset_buf || pc->map == NULL) { + if (pc->page_offset_end == pc->page_offset_buf) { /* nothing has been loaded into this page cache! */ return; } @@ -695,7 +695,7 @@ usb_pc_cpu_invalidate(struct usb_page_ca void usb_pc_cpu_flush(struct usb_page_cache *pc) { - if (pc->page_offset_end == pc->page_offset_buf || pc->map == NULL) { + if (pc->page_offset_end == pc->page_offset_buf) { /* nothing has been loaded into this page cache! */ return; } From owner-svn-src-projects@FreeBSD.ORG Thu Jun 10 21:56:14 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 945511065677; Thu, 10 Jun 2010 21:56:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83A6C8FC1B; Thu, 10 Jun 2010 21:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ALuEnn076795; Thu, 10 Jun 2010 21:56:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ALuEn6076793; Thu, 10 Jun 2010 21:56:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006102156.o5ALuEn6076793@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Jun 2010 21:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209019 - projects/altix/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 21:56:14 -0000 Author: marcel Date: Thu Jun 10 21:56:14 2010 New Revision: 209019 URL: http://svn.freebsd.org/changeset/base/209019 Log: Print a warning about NULL maps only when booting verbose. Modified: projects/altix/sys/kern/subr_busdma.c Modified: projects/altix/sys/kern/subr_busdma.c ============================================================================== --- projects/altix/sys/kern/subr_busdma.c Thu Jun 10 21:52:47 2010 (r209018) +++ projects/altix/sys/kern/subr_busdma.c Thu Jun 10 21:56:14 2010 (r209019) @@ -923,7 +923,8 @@ bus_dmamap_unload(bus_dma_tag_t dmat, bu struct bounce_page *bpage; if (map == NULL) { - warn_null_map(__func__, __builtin_return_address(0)); + if (bootverbose) + warn_null_map(__func__, __builtin_return_address(0)); return; } @@ -939,7 +940,8 @@ bus_dmamap_sync(bus_dma_tag_t dmat, bus_ struct bounce_page *bpage; if (map == NULL) { - warn_null_map(__func__, __builtin_return_address(0)); + if (bootverbose) + warn_null_map(__func__, __builtin_return_address(0)); return; } From owner-svn-src-projects@FreeBSD.ORG Fri Jun 11 03:00:50 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA7A10656C7; Fri, 11 Jun 2010 03:00:50 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 374438FC15; Fri, 11 Jun 2010 03:00:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5B30oiD045521; Fri, 11 Jun 2010 03:00:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B30noc045486; Fri, 11 Jun 2010 03:00:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006110300.o5B30noc045486@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 11 Jun 2010 03:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209027 - in projects/ppc64: . bin/sh contrib/llvm contrib/sendmail/mail.local etc/mtree lib lib/clang lib/libc/sys lib/libpmc lib/librpcsec_gss lib/msun/man release/doc/en_US.ISO8859-1... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 03:00:50 -0000 Author: nwhitehorn Date: Fri Jun 11 03:00:48 2010 New Revision: 209027 URL: http://svn.freebsd.org/changeset/base/209027 Log: IFC @ 209023 - post clang import, pre tbemd merge Added: projects/ppc64/contrib/llvm/ - copied from r209023, head/contrib/llvm/ projects/ppc64/lib/clang/ - copied from r209023, head/lib/clang/ projects/ppc64/share/man/man4/ng_patch.4 - copied unchanged from r209023, head/share/man/man4/ng_patch.4 projects/ppc64/sys/modules/netgraph/patch/ - copied from r209023, head/sys/modules/netgraph/patch/ projects/ppc64/sys/netgraph/ng_patch.c - copied unchanged from r209023, head/sys/netgraph/ng_patch.c projects/ppc64/sys/netgraph/ng_patch.h - copied unchanged from r209023, head/sys/netgraph/ng_patch.h projects/ppc64/sys/x86/x86/io_apic.c - copied unchanged from r209023, head/sys/x86/x86/io_apic.c projects/ppc64/sys/x86/x86/mca.c - copied unchanged from r209023, head/sys/x86/x86/mca.c projects/ppc64/sys/x86/x86/msi.c - copied unchanged from r209023, head/sys/x86/x86/msi.c projects/ppc64/tools/build/options/WITHOUT_CLANG - copied unchanged from r209023, head/tools/build/options/WITHOUT_CLANG projects/ppc64/tools/tools/vhba/ - copied from r209023, head/tools/tools/vhba/ projects/ppc64/usr.bin/clang/ - copied from r209023, head/usr.bin/clang/ Deleted: projects/ppc64/sys/amd64/amd64/io_apic.c projects/ppc64/sys/amd64/amd64/mca.c projects/ppc64/sys/amd64/amd64/msi.c projects/ppc64/sys/i386/i386/io_apic.c projects/ppc64/sys/i386/i386/mca.c projects/ppc64/sys/i386/i386/msi.c Modified: projects/ppc64/Makefile.inc1 projects/ppc64/bin/sh/jobs.c projects/ppc64/contrib/sendmail/mail.local/mail.local.8 projects/ppc64/etc/mtree/BSD.include.dist projects/ppc64/lib/Makefile projects/ppc64/lib/libc/sys/flock.2 projects/ppc64/lib/libc/sys/getitimer.2 projects/ppc64/lib/libc/sys/getrusage.2 projects/ppc64/lib/libc/sys/mq_close.2 projects/ppc64/lib/libc/sys/mq_getattr.2 projects/ppc64/lib/libc/sys/mq_notify.2 projects/ppc64/lib/libc/sys/mq_open.2 projects/ppc64/lib/libc/sys/mq_receive.2 projects/ppc64/lib/libc/sys/mq_send.2 projects/ppc64/lib/libc/sys/mq_setattr.2 projects/ppc64/lib/libpmc/pmc.corei7.3 projects/ppc64/lib/libpmc/pmc.corei7uc.3 projects/ppc64/lib/libpmc/pmc.westmereuc.3 projects/ppc64/lib/librpcsec_gss/rpc_gss_seccreate.3 projects/ppc64/lib/msun/man/atan2.3 projects/ppc64/release/doc/en_US.ISO8859-1/relnotes/article.sgml projects/ppc64/sbin/geom/misc/subr.c projects/ppc64/share/man/man4/Makefile projects/ppc64/share/man/man5/a.out.5 projects/ppc64/share/man/man5/src.conf.5 projects/ppc64/share/man/man5/stab.5 projects/ppc64/share/mk/bsd.own.mk projects/ppc64/sys/amd64/amd64/fpu.c projects/ppc64/sys/amd64/amd64/pmap.c projects/ppc64/sys/amd64/linux32/linux32_machdep.c projects/ppc64/sys/arm/arm/pmap.c projects/ppc64/sys/cam/cam_debug.h projects/ppc64/sys/cam/cam_xpt.c projects/ppc64/sys/cam/cam_xpt_internal.h projects/ppc64/sys/cam/scsi/scsi_all.c projects/ppc64/sys/cam/scsi/scsi_all.h projects/ppc64/sys/cam/scsi/scsi_ch.h projects/ppc64/sys/cam/scsi/scsi_da.c projects/ppc64/sys/cam/scsi/scsi_xpt.c projects/ppc64/sys/conf/NOTES projects/ppc64/sys/conf/files projects/ppc64/sys/conf/files.amd64 projects/ppc64/sys/conf/files.i386 projects/ppc64/sys/conf/files.pc98 projects/ppc64/sys/conf/options projects/ppc64/sys/dev/acpica/acpi.c projects/ppc64/sys/dev/ahci/ahci.c projects/ppc64/sys/dev/bge/if_bgereg.h projects/ppc64/sys/dev/cxgb/cxgb_main.c projects/ppc64/sys/dev/isp/isp_freebsd.c projects/ppc64/sys/dev/isp/isp_library.c projects/ppc64/sys/dev/sound/pci/hda/hdac.c projects/ppc64/sys/dev/twa/tw_cl.h projects/ppc64/sys/dev/twa/tw_cl_fwif.h projects/ppc64/sys/dev/twa/tw_cl_init.c projects/ppc64/sys/dev/twa/tw_cl_intr.c projects/ppc64/sys/dev/twa/tw_cl_io.c projects/ppc64/sys/dev/twa/tw_cl_misc.c projects/ppc64/sys/dev/twa/tw_cl_share.h projects/ppc64/sys/dev/twa/tw_osl.h projects/ppc64/sys/dev/twa/tw_osl_cam.c projects/ppc64/sys/dev/twa/tw_osl_externs.h projects/ppc64/sys/dev/twa/tw_osl_freebsd.c projects/ppc64/sys/dev/twa/tw_osl_inline.h projects/ppc64/sys/dev/twa/tw_osl_share.h projects/ppc64/sys/dev/xen/netfront/netfront.c projects/ppc64/sys/fs/devfs/devfs.h projects/ppc64/sys/fs/devfs/devfs_devs.c projects/ppc64/sys/fs/devfs/devfs_vnops.c projects/ppc64/sys/geom/geom_event.c projects/ppc64/sys/geom/geom_io.c projects/ppc64/sys/i386/i386/pmap.c projects/ppc64/sys/i386/linux/linux_machdep.c projects/ppc64/sys/i386/xen/pmap.c projects/ppc64/sys/ia64/ia64/pmap.c projects/ppc64/sys/kern/kern_intr.c projects/ppc64/sys/kern/kern_sx.c projects/ppc64/sys/kern/sched_ule.c projects/ppc64/sys/kern/subr_bus.c projects/ppc64/sys/kern/vfs_bio.c projects/ppc64/sys/mips/mips/pmap.c projects/ppc64/sys/modules/netgraph/Makefile projects/ppc64/sys/net80211/ieee80211_hwmp.c projects/ppc64/sys/net80211/ieee80211_sta.c projects/ppc64/sys/netinet/sctp_constants.h projects/ppc64/sys/netinet/sctp_indata.c projects/ppc64/sys/netinet/sctp_input.c projects/ppc64/sys/netinet/sctp_lock_bsd.h projects/ppc64/sys/netinet/sctp_pcb.c projects/ppc64/sys/netinet/sctp_sysctl.c projects/ppc64/sys/netinet/sctputil.c projects/ppc64/sys/powerpc/aim/mmu_oea.c projects/ppc64/sys/powerpc/aim/mmu_oea64.c projects/ppc64/sys/powerpc/booke/pmap.c projects/ppc64/sys/sparc64/sparc64/pmap.c projects/ppc64/sys/sun4v/sun4v/pmap.c projects/ppc64/sys/sys/nlist_aout.h projects/ppc64/sys/sys/param.h projects/ppc64/sys/sys/proc.h projects/ppc64/sys/vm/vm_page.c projects/ppc64/sys/vm/vm_page.h projects/ppc64/sys/vm/vm_pageout.c projects/ppc64/tools/tools/netrate/tcpp/tcpp.c projects/ppc64/tools/tools/netrate/tcpp/tcpp.h projects/ppc64/tools/tools/netrate/tcpp/tcpp_client.c projects/ppc64/tools/tools/netrate/tcpp/tcpp_server.c projects/ppc64/usr.bin/Makefile projects/ppc64/usr.bin/calendar/locale.c projects/ppc64/usr.bin/dc/bcode.c projects/ppc64/usr.bin/dc/dc.c projects/ppc64/usr.bin/gzip/gzip.c projects/ppc64/usr.bin/ipcs/ipc.c projects/ppc64/usr.bin/unzip/unzip.c projects/ppc64/usr.sbin/nfsdumpstate/nfsdumpstate.8 projects/ppc64/usr.sbin/sysinstall/tcpip.c projects/ppc64/usr.sbin/timed/timed/timed.8 Directory Properties: projects/ppc64/ (props changed) projects/ppc64/cddl/contrib/opensolaris/ (props changed) projects/ppc64/contrib/ee/ (props changed) projects/ppc64/contrib/expat/ (props changed) projects/ppc64/contrib/file/ (props changed) projects/ppc64/contrib/gdb/ (props changed) projects/ppc64/contrib/gnu-sort/ (props changed) projects/ppc64/contrib/groff/ (props changed) projects/ppc64/contrib/less/ (props changed) projects/ppc64/contrib/libpcap/ (props changed) projects/ppc64/contrib/ncurses/ (props changed) projects/ppc64/contrib/one-true-awk/ (props changed) projects/ppc64/contrib/openbsm/ (props changed) projects/ppc64/contrib/openpam/ (props changed) projects/ppc64/contrib/pf/ (props changed) projects/ppc64/contrib/tcpdump/ (props changed) projects/ppc64/contrib/tcsh/ (props changed) projects/ppc64/contrib/tzcode/stdtime/ (props changed) projects/ppc64/contrib/tzcode/zic/ (props changed) projects/ppc64/contrib/tzdata/ (props changed) projects/ppc64/contrib/wpa/ (props changed) projects/ppc64/lib/libutil/ (props changed) projects/ppc64/lib/libz/ (props changed) projects/ppc64/sbin/ (props changed) projects/ppc64/sbin/ipfw/ (props changed) projects/ppc64/sys/ (props changed) projects/ppc64/sys/amd64/include/xen/ (props changed) projects/ppc64/sys/cddl/contrib/opensolaris/ (props changed) projects/ppc64/sys/contrib/dev/acpica/ (props changed) projects/ppc64/sys/contrib/x86emu/ (props changed) projects/ppc64/sys/dev/xen/xenpci/ (props changed) projects/ppc64/usr.bin/csup/ (props changed) projects/ppc64/usr.bin/procstat/ (props changed) Modified: projects/ppc64/Makefile.inc1 ============================================================================== --- projects/ppc64/Makefile.inc1 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/Makefile.inc1 Fri Jun 11 03:00:48 2010 (r209027) @@ -970,6 +970,13 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre _crunchgen= usr.sbin/crunch/crunchgen .endif +# XXX: There is no way to specify bootstrap tools depending on MK-flags +# with different per-architecture default values. Always build tblgen. +_clang_tblgen= \ + lib/clang/libllvmsupport \ + lib/clang/libllvmsystem \ + usr.bin/clang/tblgen + .if ${MK_CDDL} != "no" _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge @@ -977,6 +984,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ bootstrap-tools: .for _tool in \ + ${_clang_tblgen} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ Modified: projects/ppc64/bin/sh/jobs.c ============================================================================== --- projects/ppc64/bin/sh/jobs.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/bin/sh/jobs.c Fri Jun 11 03:00:48 2010 (r209027) @@ -866,6 +866,7 @@ waitforjob(struct job *jp, int *origstat { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -903,6 +904,11 @@ waitforjob(struct job *jp, int *origstat else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } Modified: projects/ppc64/contrib/sendmail/mail.local/mail.local.8 ============================================================================== --- projects/ppc64/contrib/sendmail/mail.local/mail.local.8 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/contrib/sendmail/mail.local/mail.local.8 Fri Jun 11 03:00:48 2010 (r209027) @@ -39,9 +39,7 @@ The options are as follows: Do not advertise 8BITMIME support in LMTP mode. .TP .B \-B -Turn off the attempts to notify the -.Dq biff -service. +Turn off the attempts to notify the ``biff'' service. .TP .B \-b Return a permanent error instead of a temporary error @@ -63,11 +61,8 @@ Specify the sender's name. Turn on LMTP mode. .TP .B \-s -Turn off the -.Xr fsync 2 -call that forces the mailbox to be committed to disk before returning a -.Dq success -status. +Turn off the fsync(2) call that forces the mailbox to be committed +to disk before returning a "success" status. .TP .BI \-r " from" Specify the sender's name (for backward compatibility). Modified: projects/ppc64/etc/mtree/BSD.include.dist ============================================================================== --- projects/ppc64/etc/mtree/BSD.include.dist Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/etc/mtree/BSD.include.dist Fri Jun 11 03:00:48 2010 (r209027) @@ -83,6 +83,10 @@ scsi .. .. + clang + 2.0 + .. + .. crypto .. dev Modified: projects/ppc64/lib/Makefile ============================================================================== --- projects/ppc64/lib/Makefile Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/Makefile Fri Jun 11 03:00:48 2010 (r209027) @@ -108,7 +108,8 @@ SUBDIR= ${SUBDIR_ORDERED} \ libwrap \ liby \ libz \ - ${_bind} + ${_bind} \ + ${_clang} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf @@ -137,6 +138,10 @@ _libsdp= libsdp _libbsnmp= libbsnmp .endif +.if ${MK_CLANG} != "no" +_clang= clang +.endif + .if ${MK_GPIB} != "no" _libgpib= libgpib .endif Modified: projects/ppc64/lib/libc/sys/flock.2 ============================================================================== --- projects/ppc64/lib/libc/sys/flock.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/flock.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -38,10 +38,10 @@ .Lb libc .Sh SYNOPSIS .In sys/file.h -.Fd "#define LOCK_SH 0x01 /* shared file lock */" -.Fd "#define LOCK_EX 0x02 /* exclusive file lock */" -.Fd "#define LOCK_NB 0x04 /* do not block when locking */" -.Fd "#define LOCK_UN 0x08 /* unlock file */" +.Fd "#define LOCK_SH 0x01 /* shared file lock */" +.Fd "#define LOCK_EX 0x02 /* exclusive file lock */" +.Fd "#define LOCK_NB 0x04 /* do not block when locking */" +.Fd "#define LOCK_UN 0x08 /* unlock file */" .Ft int .Fn flock "int fd" "int operation" .Sh DESCRIPTION Modified: projects/ppc64/lib/libc/sys/getitimer.2 ============================================================================== --- projects/ppc64/lib/libc/sys/getitimer.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/getitimer.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -39,9 +39,9 @@ .Lb libc .Sh SYNOPSIS .In sys/time.h -.Fd "#define ITIMER_REAL 0" -.Fd "#define ITIMER_VIRTUAL 1" -.Fd "#define ITIMER_PROF 2" +.Fd "#define ITIMER_REAL 0" +.Fd "#define ITIMER_VIRTUAL 1" +.Fd "#define ITIMER_PROF 2" .Ft int .Fn getitimer "int which" "struct itimerval *value" .Ft int Modified: projects/ppc64/lib/libc/sys/getrusage.2 ============================================================================== --- projects/ppc64/lib/libc/sys/getrusage.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/getrusage.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -40,9 +40,9 @@ .In sys/types.h .In sys/time.h .In sys/resource.h -.Fd "#define RUSAGE_SELF 0" -.Fd "#define RUSAGE_CHILDREN -1" -.Fd "#define RUSAGE_THREAD 1" +.Fd "#define RUSAGE_SELF 0" +.Fd "#define RUSAGE_CHILDREN -1" +.Fd "#define RUSAGE_THREAD 1" .Ft int .Fn getrusage "int who" "struct rusage *rusage" .Sh DESCRIPTION Modified: projects/ppc64/lib/libc/sys/mq_close.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_close.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_close.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -102,4 +102,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_getattr.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_getattr.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_getattr.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -124,4 +124,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_notify.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_notify.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_notify.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -148,4 +148,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_open.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_open.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_open.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -320,4 +320,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_receive.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_receive.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_receive.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -214,4 +214,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_send.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_send.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_send.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -233,4 +233,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libc/sys/mq_setattr.2 ============================================================================== --- projects/ppc64/lib/libc/sys/mq_setattr.2 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libc/sys/mq_setattr.2 Fri Jun 11 03:00:48 2010 (r209027) @@ -120,4 +120,4 @@ Electrical and Electronics Engineers, In event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at - http://www.opengroup.org/unix/online.html. +http://www.opengroup.org/unix/online.html. Modified: projects/ppc64/lib/libpmc/pmc.corei7.3 ============================================================================== --- projects/ppc64/lib/libpmc/pmc.corei7.3 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libpmc/pmc.corei7.3 Fri Jun 11 03:00:48 2010 (r209027) @@ -613,7 +613,7 @@ Counter 0, 1 only .It Li L1D_CACHE_LOCK.HIT .Pq Event 42H , Umask 01H Counts retired load locks that hit in the L1 data cache or hit in an already -allocated fill buffer. The lock portion of the load lock transaction must +allocated fill buffer. The lock portion of the load lock transaction must hit in the L1D. The initial load will pull the lock into the L1 data cache. Counter 0, 1 only Modified: projects/ppc64/lib/libpmc/pmc.corei7uc.3 ============================================================================== --- projects/ppc64/lib/libpmc/pmc.corei7uc.3 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libpmc/pmc.corei7uc.3 Fri Jun 11 03:00:48 2010 (r209027) @@ -151,14 +151,14 @@ count is divided by this count to obtain .Pq Event 03H , Umask 08H Counts the number of GQ read tracker entries that are allocated in the read tracker, have missed in the L3 and have not acquired a Request Transaction -ID. The GQ read tracker L3 miss to RTID acquired occupancy count is +ID. The GQ read tracker L3 miss to RTID acquired occupancy count is divided by this count to obtain the average latency for a read L3 miss to acquire an RTID. .It Li GQ_ALLOC.WT_TO_RTID_ACQUIRED .Pq Event 03H , Umask 10H Counts the number of GQ write tracker entries that are allocated in the write tracker, have missed in the L3 and have not acquired a Request -Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is +Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is divided by this count to obtain the average latency for a write L3 miss to acquire an RTID. .It Li GQ_ALLOC.WRITE_TRACKER Modified: projects/ppc64/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- projects/ppc64/lib/libpmc/pmc.westmereuc.3 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/libpmc/pmc.westmereuc.3 Fri Jun 11 03:00:48 2010 (r209027) @@ -157,14 +157,14 @@ count is divided by this count to obtain .Pq Event 03H , Umask 08H Counts the number of GQ read tracker entries that are allocated in the read tracker, have missed in the L3 and have not acquired a Request Transaction -ID. The GQ read tracker L3 miss to RTID acquired occupancy count is +ID. The GQ read tracker L3 miss to RTID acquired occupancy count is divided by this count to obtain the average latency for a read L3 miss to acquire an RTID. .It Li GQ_ALLOC.WT_TO_RTID_ACQUIRED .Pq Event 03H , Umask 10H Counts the number of GQ write tracker entries that are allocated in the write tracker, have missed in the L3 and have not acquired a Request -Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is +Transaction ID. The GQ write tracker L3 miss to RTID occupancy count is divided by this count to obtain the average latency for a write L3 miss to acquire an RTID. .It Li GQ_ALLOC.WRITE_TRACKER Modified: projects/ppc64/lib/librpcsec_gss/rpc_gss_seccreate.3 ============================================================================== --- projects/ppc64/lib/librpcsec_gss/rpc_gss_seccreate.3 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/librpcsec_gss/rpc_gss_seccreate.3 Fri Jun 11 03:00:48 2010 (r209027) @@ -74,7 +74,7 @@ RPC headers and data are integrity prote RPC headers are integrity protected by a checksum and data is encrypted. .El .It qop -Desired quality of protection or NULL for the default. +Desired quality of protection or NULL for the default. Available values are listed in /etc/gss/qop .It options_req Extra security context options to be passed to the underlying GSS-API Modified: projects/ppc64/lib/msun/man/atan2.3 ============================================================================== --- projects/ppc64/lib/msun/man/atan2.3 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/lib/msun/man/atan2.3 Fri Jun 11 03:00:48 2010 (r209027) @@ -66,12 +66,6 @@ functions compute the principal value of .Fa y/ Ns Ar x , using the signs of both arguments to determine the quadrant of the return value. -.ie '\*[.T]'utf8' \{\ -. ds Th \[*h] -.\} -.el \{\ -. ds Th theta -.\} .Pp The .Fn carg , @@ -80,8 +74,8 @@ and .Fn cargl functions compute the complex argument (or phase angle) of .Fa z . -The complex argument is the number \*(Th such that -.Li z = r * e^(I * \*(Th) , +The complex argument is the number theta such that +.Li z = r * e^(I * theta) , where .Li r = cabs(z) . The call Modified: projects/ppc64/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- projects/ppc64/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Jun 11 03:00:48 2010 (r209027) @@ -313,6 +313,11 @@ &man.clear.locks.8; command has been added to clear locks held on behalf of an NFS client. + The ZFS file system + has been upgraded to version 14. Additional changes include + support for NFSv4 ACLs, a speedup of zfs send and an improved L2ARC. + New statistics for prefetch and L2ARC have been introduced. + Modified: projects/ppc64/sbin/geom/misc/subr.c ============================================================================== --- projects/ppc64/sbin/geom/misc/subr.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sbin/geom/misc/subr.c Fri Jun 11 03:00:48 2010 (r209027) @@ -436,6 +436,7 @@ gctl_delete_param(struct gctl_req *req, if (i == req->narg) return (ENOENT); + free(ap->name); req->narg--; while (i < req->narg) { req->arg[i] = req->arg[i + 1]; Modified: projects/ppc64/share/man/man4/Makefile ============================================================================== --- projects/ppc64/share/man/man4/Makefile Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/share/man/man4/Makefile Fri Jun 11 03:00:48 2010 (r209027) @@ -274,6 +274,7 @@ MAN= aac.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ + ng_patch.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ Copied: projects/ppc64/share/man/man4/ng_patch.4 (from r209023, head/share/man/man4/ng_patch.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/share/man/man4/ng_patch.4 Fri Jun 11 03:00:48 2010 (r209027, copy of r209023, head/share/man/man4/ng_patch.4) @@ -0,0 +1,235 @@ +.\" Copyright (c) 2010 Maxim Ignatenko +.\" Copyright (c) 2010 Vadim Goncharov +.\" 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 June 9, 2010 +.Dt NG_PATCH 4 +.Os +.Sh NAME +.Nm ng_patch +.Nd "trivial mbuf data modifying netgraph node type" +.Sh SYNOPSIS +.In netgraph/ng_patch.h +.Sh DESCRIPTION +The +.Nm patch +node performs data modification of packets passing through it. +Modifications are restricted to a subset of C language operations +on unsigned integers of 8, 16, 32 or 64 bit size. +These are: set to new value (=), addition (+=), subtraction (-=), +multiplication (*=), division (/=), negation (= -), +bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), +shift left (<<=), shift right (>>=). +A negation operation is the one exception: integer is treated as signed +and second operand (the +.Va value ) +is not used. +There may be several modification operations, they are all applied +to a packet sequentially in order they were specified by user. +Data payload of packet is viewed as array of bytes, with zero offset +corresponding to the very first byte of packet headers, and +.Va length +bytes beginning from +.Va offset +are taken as a single integer in network byte order. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width indent +.It Va in +Packets received on this hook are modified according to rules specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. +Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width indent +.It Dv NGM_PATCH_SETCONFIG Pq Li setconfig +This command sets the sequence of modify operations +that will be applied to incoming data on a hook. +The following +.Vt "struct ng_patch_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_patch_op { + uint64_t value; + uint32_t offset; + uint16_t length; /* 1,2,4 or 8 bytes */ + uint16_t mode; +}; +/* Patching modes */ +#define NG_PATCH_MODE_SET 1 +#define NG_PATCH_MODE_ADD 2 +#define NG_PATCH_MODE_SUB 3 +#define NG_PATCH_MODE_MUL 4 +#define NG_PATCH_MODE_DIV 5 +#define NG_PATCH_MODE_NEG 6 +#define NG_PATCH_MODE_AND 7 +#define NG_PATCH_MODE_OR 8 +#define NG_PATCH_MODE_XOR 9 +#define NG_PATCH_MODE_SHL 10 +#define NG_PATCH_MODE_SHR 11 + +struct ng_patch_config { + uint32_t count; + uint32_t csum_flags; + struct ng_patch_op ops[]; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP +(other values are ignored) for instructing the IP stack to recalculate the +corresponding checksum before transmitting packet on output interface. +The +.Nm +node does not do any checksum correction by itself. +.It Dv NGM_PATCH_GETCONFIG Pq Li getconfig +This control message obtains current set of modify operations, +returned as +.Vt "struct ng_patch_config" . +.It Dv NGM_PATCH_GET_STATS Pq Li getstats +Returns node statistics as a +.Vt "struct ng_patch_stats" . +.It Dv NGM_PATCH_CLR_STATS Pq Li clrstats +Clear node statistics. +.It Dv NGM_PATCH_GETCLR_STATS Pq Li getclrstats +This command is identical to +.Dv NGM_PATCH_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +The +.Nm +node allows to modify TTL and TOS/DSCP fields in IP packets. +Suppose you have two adjacent simplex links to remote network +(e.g.\& satellite), so that the packets expiring in between +will generate unwanted ICMP-replies which have to go forth, not back. +Thus you need to raise TTL of every packet entering link link by 2 +to ensure the TTL will not reach zero there. +So you setup +.Xr ipfw 8 +rule with +.Cm netgraph +action to inject packets going to other end of simplex link by the +following +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 200 in + name ipfw:200 ttl_add + msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \e + { mode=2 value=3 length=1 offset=8 } ] } +SEQ +/sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net +.Ed +.Pp +Here +.Dq Li ttl_add +node of type +.Nm +configured to add (mode +.Dv NG_PATCH_MODE_ADD ) +a +.Va value +of 3 to a one-byte TTL field, which is 9th byte of IP packet header. +.Pp +Another example would be two consecutive modifications of packet TOS +field: say, you need to clear the +.Dv IPTOS_THROUGHPUT +bit and set the +.Dv IPTOS_MINCOST +bit. +So you do: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 300 in + name ipfw:300 tos_chg + msg tos_chg: setconfig { count=2 csum_flags=1 ops=[ \e + { mode=7 value=0xf7 length=1 offset=1 } \e + { mode=8 value=0x02 length=1 offset=1 } ] } +SEQ +/sbin/ipfw add 160 netgraph 600 ip from any to any not dst-port 80 +.Ed +.Pp +This first does +.Dv NG_PATCH_MODE_AND +clearing the fourth bit and then +.Dv NG_PATCH_MODE_OR +setting the third bit. +.Pp +In both examples the +.Va csum_flags +field indicates that IP checksum (but not TCP or UDP checksum) should be +recalculated before transmit. +.Pp +Note: one should ensure that packets are returned to ipfw after processing +inside +.Xr netgraph 4 , +by setting appropriate +.Xr sysctl 8 +variable: +.Bd -literal -offset 4n +sysctl net.inet.ip.fw.one_pass=0 +.Ed +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ipfw 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 8.1 . +.Sh AUTHORS +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +This manual page was written by +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . +.Sh BUGS +Node blindly tries to apply every patching operation to each packet +(except those which offset if greater than length of the packet), +so be sure that you supply only the right packets to it (e.g. changing +bytes in the ARP packets meant to be in IP header could corrupt +them and make your machine unreachable from the network). +.Pp +.Em !!! WARNING !!! +.Pp +Output path of the IP stack assumes correct fields and lengths in the +packets - changing them by mistake to incorrect values can cause +unpredictable results including kernel panics. Modified: projects/ppc64/share/man/man5/a.out.5 ============================================================================== --- projects/ppc64/share/man/man5/a.out.5 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/share/man/man5/a.out.5 Fri Jun 11 03:00:48 2010 (r209027) @@ -35,7 +35,7 @@ .\" @(#)a.out.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt A.OUT 5 .Os .Sh NAME @@ -307,13 +307,13 @@ structures: .Bd -literal -offset indent struct nlist { union { - char *n_name; - long n_strx; + const char *n_name; + long n_strx; } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; }; .Ed .Pp Modified: projects/ppc64/share/man/man5/src.conf.5 ============================================================================== --- projects/ppc64/share/man/man5/src.conf.5 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/share/man/man5/src.conf.5 Fri Jun 11 03:00:48 2010 (r209027) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd May 19, 2010 +.Dd June 10, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -247,6 +247,9 @@ When set, it also enforces the following .It .Va WITHOUT_ZFS .El +.It Va WITHOUT_CLANG +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed +Set to not build the Clang C/C++ compiler. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -297,6 +300,10 @@ dynamically. .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . +.It Va WITH_FDT +.\" from FreeBSD: head/tools/build/options/WITH_FDT 208537 2010-05-25 15:12:21Z raj +Set to build Flattened Device Tree support as part of the base system. This +includes the device tree compiler (dtc) and libfdt support library. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 183306 2008-09-23 16:15:42Z sam Set to not build or install programs @@ -799,6 +806,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_CLANG +.It .Va WITHOUT_GDB .El .It Va WITHOUT_USB Modified: projects/ppc64/share/man/man5/stab.5 ============================================================================== --- projects/ppc64/share/man/man5/stab.5 Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/share/man/man5/stab.5 Fri Jun 11 03:00:48 2010 (r209027) @@ -32,7 +32,7 @@ .\" @(#)stab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt STAB 5 .Os .Sh NAME @@ -79,7 +79,7 @@ consists of the following structure: struct nlist { union { - char *n_name; /* for use when in-core */ + const char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag */ Modified: projects/ppc64/share/mk/bsd.own.mk ============================================================================== --- projects/ppc64/share/mk/bsd.own.mk Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/share/mk/bsd.own.mk Fri Jun 11 03:00:48 2010 (r209027) @@ -288,6 +288,18 @@ _no_fdt= FDT .endif # +# Default behaviour of MK_CLANG depends on the architecture. +# +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_ARCH} == "powerpc" +_clang_yes=CLANG +_clang_no= +.else +_clang_yes= +_clang_no=CLANG +.endif + +# # MK_* options which default to "yes". # .for var in \ @@ -314,6 +326,7 @@ _no_fdt= FDT BZIP2 \ CALENDAR \ CDDL \ + ${_clang_yes} \ CPP \ CRYPT \ CTM \ @@ -417,6 +430,7 @@ MK_${var}:= yes BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + ${_clang_no} \ ${_no_fdt} \ HESIOD \ IDEA @@ -497,6 +511,7 @@ MK_GROFF:= no .endif .if ${MK_TOOLCHAIN} == "no" +MK_CLANG:= no MK_GDB:= no .endif Modified: projects/ppc64/sys/amd64/amd64/fpu.c ============================================================================== --- projects/ppc64/sys/amd64/amd64/fpu.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sys/amd64/amd64/fpu.c Fri Jun 11 03:00:48 2010 (r209027) @@ -453,8 +453,8 @@ fpudrop() int fpugetuserregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -477,8 +477,8 @@ fpugetuserregs(struct thread *td, struct int fpugetregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { @@ -504,8 +504,8 @@ fpugetregs(struct thread *td, struct sav void fpusetuserregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; s = intr_disable(); @@ -525,8 +525,8 @@ fpusetuserregs(struct thread *td, struct void fpusetregs(struct thread *td, struct savefpu *addr) { - register_t s; struct pcb *pcb; + register_t s; pcb = td->td_pcb; s = intr_disable(); Modified: projects/ppc64/sys/amd64/amd64/pmap.c ============================================================================== --- projects/ppc64/sys/amd64/amd64/pmap.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sys/amd64/amd64/pmap.c Fri Jun 11 03:00:48 2010 (r209027) @@ -3899,30 +3899,35 @@ pmap_page_exists_quick(pmap_t pmap, vm_p struct md_page *pvh; pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - if (loops < 16) { + if (!rv && loops < 16) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { - if (PV_PMAP(pv) == pmap) - return (TRUE); + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } loops++; if (loops >= 16) break; } } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4335,10 +4340,10 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - if (m->flags & PG_FICTITIOUS) - return (rtval); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + vm_page_lock_queues(); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4362,7 +4367,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4391,6 +4396,8 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: + vm_page_unlock_queues(); return (rtval); } Modified: projects/ppc64/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- projects/ppc64/sys/amd64/linux32/linux32_machdep.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sys/amd64/linux32/linux32_machdep.c Fri Jun 11 03:00:48 2010 (r209027) @@ -835,9 +835,13 @@ linux_mmap_common(struct thread *td, l_u bsd_args.flags |= MAP_PRIVATE; if (flags & LINUX_MAP_FIXED) bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) + if (flags & LINUX_MAP_ANON) { + /* Enforce pos to be on page boundary, then ignore. */ + if ((pos & PAGE_MASK) != 0) + return (EINVAL); + pos = 0; bsd_args.flags |= MAP_ANON; - else + } else bsd_args.flags |= MAP_NOSYNC; if (flags & LINUX_MAP_GROWSDOWN) bsd_args.flags |= MAP_STACK; Modified: projects/ppc64/sys/arm/arm/pmap.c ============================================================================== --- projects/ppc64/sys/arm/arm/pmap.c Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sys/arm/arm/pmap.c Fri Jun 11 03:00:48 2010 (r209027) @@ -1423,7 +1423,7 @@ pmap_clearbit(struct vm_page *pg, u_int u_int oflags; int count = 0; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; @@ -1433,6 +1433,7 @@ pmap_clearbit(struct vm_page *pg, u_int pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { + vm_page_unlock_queues(); return (0); } @@ -1568,6 +1569,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) vm_page_flag_clear(pg, PG_WRITEABLE); + vm_page_unlock_queues(); return (count); } @@ -4417,24 +4419,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - /* - * Not found, check current mappings returning immediately - */ - for (pv = TAILQ_FIRST(&m->md.pv_list); - pv; - pv = TAILQ_NEXT(pv, pv_list)) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4469,8 +4470,8 @@ int pmap_ts_referenced(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return (0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); return (pmap_clearbit(m, PVF_REF)); } @@ -4508,10 +4509,8 @@ pmap_clear_modify(vm_page_t m) */ if ((m->flags & PG_WRITEABLE) == 0) return; - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); - vm_page_unlock_queues(); } @@ -4541,10 +4540,8 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_REF) pmap_clearbit(m, PVF_REF); - vm_page_unlock_queues(); } @@ -4565,11 +4562,8 @@ pmap_remove_write(vm_page_t m) */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) != 0 || - (m->flags & PG_WRITEABLE) != 0) { - vm_page_lock_queues(); + (m->flags & PG_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); - vm_page_unlock_queues(); - } } Modified: projects/ppc64/sys/cam/cam_debug.h ============================================================================== --- projects/ppc64/sys/cam/cam_debug.h Fri Jun 11 03:00:32 2010 (r209026) +++ projects/ppc64/sys/cam/cam_debug.h Fri Jun 11 03:00:48 2010 (r209027) @@ -40,7 +40,8 @@ typedef enum { CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */ CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */ CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */ - CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */ + CAM_DEBUG_PERIPH = 0x20, /* print out peripheral calls */ + CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; #if defined(CAMDEBUG) && defined(_KERNEL) @@ -58,6 +59,7 @@ extern u_int32_t cam_debug_delay; && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) + #define CAM_DEBUG(path, flag, printfargs) \ if ((cam_dflags & (flag)) \ && (cam_dpath != NULL) \ @@ -68,6 +70,7 @@ extern u_int32_t cam_debug_delay; if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } + #define CAM_DEBUG_PRINT(flag, printfargs) \ if (cam_dflags & (flag)) { \ printf("cam_debug: "); \ @@ -76,11 +79,20 @@ extern u_int32_t cam_debug_delay; DELAY(cam_debug_delay); \ } +#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ + if (cam_dflags & (flag)) { \ + xpt_print(path, "cam_debug: "); \ + printf printfargs; \ + if (cam_debug_delay != 0) \ + DELAY(cam_debug_delay); \ + } + #else /* !CAMDEBUG || !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) +#define CAM_DEBUG_PATH_PRINT(A, B, C) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Jun 11 13:10:33 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ACF01065670; Fri, 11 Jun 2010 13:10:33 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55B708FC1C; Fri, 11 Jun 2010 13:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BDAXth083582; Fri, 11 Jun 2010 13:10:33 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BDAXFK083564; Fri, 11 Jun 2010 13:10:33 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006111310.o5BDAXFK083564@svn.freebsd.org> From: Roman Divacky Date: Fri, 11 Jun 2010 13:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209040 - in projects/clangbsd: . bin/chio bin/cp bin/date bin/getfacl bin/sh cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas/config contrib/binu... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 13:10:33 -0000 Author: rdivacky Date: Fri Jun 11 13:10:32 2010 New Revision: 209040 URL: http://svn.freebsd.org/changeset/base/209040 Log: Merge form head. Added: projects/clangbsd/contrib/gcc/config/fixdfdi.c - copied unchanged from r209037, head/contrib/gcc/config/fixdfdi.c projects/clangbsd/contrib/gcc/config/fixsfdi.c - copied unchanged from r209037, head/contrib/gcc/config/fixsfdi.c projects/clangbsd/contrib/gcc/config/fixunsdfsi.c - copied unchanged from r209037, head/contrib/gcc/config/fixunsdfsi.c projects/clangbsd/contrib/gcc/config/fixunssfsi.c - copied unchanged from r209037, head/contrib/gcc/config/fixunssfsi.c projects/clangbsd/contrib/gcc/config/floatdidf.c - copied unchanged from r209037, head/contrib/gcc/config/floatdidf.c projects/clangbsd/contrib/gcc/config/floatdisf.c - copied unchanged from r209037, head/contrib/gcc/config/floatdisf.c projects/clangbsd/contrib/gcc/config/floatundidf.c - copied unchanged from r209037, head/contrib/gcc/config/floatundidf.c projects/clangbsd/contrib/gcc/config/floatundisf.c - copied unchanged from r209037, head/contrib/gcc/config/floatundisf.c projects/clangbsd/share/man/man4/ng_patch.4 - copied unchanged from r209037, head/share/man/man4/ng_patch.4 projects/clangbsd/share/mk/bsd.arch.inc.mk - copied unchanged from r209037, head/share/mk/bsd.arch.inc.mk projects/clangbsd/sys/dev/fdt/ - copied from r209037, head/sys/dev/fdt/ projects/clangbsd/sys/dev/uart/uart_bus_fdt.c - copied unchanged from r209037, head/sys/dev/uart/uart_bus_fdt.c projects/clangbsd/sys/libkern/memchr.c - copied unchanged from r209037, head/sys/libkern/memchr.c projects/clangbsd/sys/modules/netgraph/patch/ - copied from r209037, head/sys/modules/netgraph/patch/ projects/clangbsd/sys/netgraph/ng_patch.c - copied unchanged from r209037, head/sys/netgraph/ng_patch.c projects/clangbsd/sys/netgraph/ng_patch.h - copied unchanged from r209037, head/sys/netgraph/ng_patch.h projects/clangbsd/sys/powerpc/powermac/smusat.c - copied unchanged from r209037, head/sys/powerpc/powermac/smusat.c projects/clangbsd/sys/tools/fdt/ - copied from r209037, head/sys/tools/fdt/ projects/clangbsd/sys/x86/x86/io_apic.c - copied unchanged from r209037, head/sys/x86/x86/io_apic.c projects/clangbsd/sys/x86/x86/mca.c - copied unchanged from r209037, head/sys/x86/x86/mca.c projects/clangbsd/sys/x86/x86/msi.c - copied unchanged from r209037, head/sys/x86/x86/msi.c projects/clangbsd/tools/build/options/WITHOUT_CLANG - copied unchanged from r209037, head/tools/build/options/WITHOUT_CLANG projects/clangbsd/tools/regression/usr.bin/jot/regress.rand1.out - copied unchanged from r209037, head/tools/regression/usr.bin/jot/regress.rand1.out projects/clangbsd/tools/regression/usr.bin/jot/regress.rand2.out - copied unchanged from r209037, head/tools/regression/usr.bin/jot/regress.rand2.out projects/clangbsd/tools/regression/usr.bin/jot/regress.stutter2.out - copied unchanged from r209037, head/tools/regression/usr.bin/jot/regress.stutter2.out projects/clangbsd/tools/tools/vhba/ - copied from r209037, head/tools/tools/vhba/ Deleted: projects/clangbsd/sys/amd64/amd64/io_apic.c projects/clangbsd/sys/amd64/amd64/mca.c projects/clangbsd/sys/amd64/amd64/msi.c projects/clangbsd/sys/i386/i386/io_apic.c projects/clangbsd/sys/i386/i386/mca.c projects/clangbsd/sys/i386/i386/msi.c Modified: projects/clangbsd/Makefile.inc1 projects/clangbsd/bin/chio/chio.c projects/clangbsd/bin/cp/cp.c projects/clangbsd/bin/date/date.1 projects/clangbsd/bin/getfacl/getfacl.1 projects/clangbsd/bin/sh/histedit.c projects/clangbsd/bin/sh/jobs.c projects/clangbsd/bin/sh/myhistedit.h projects/clangbsd/bin/sh/var.c projects/clangbsd/bin/sh/var.h projects/clangbsd/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l projects/clangbsd/contrib/binutils/bfd/archures.c projects/clangbsd/contrib/binutils/bfd/bfd-in2.h projects/clangbsd/contrib/binutils/bfd/cpu-mips.c projects/clangbsd/contrib/binutils/bfd/elfxx-mips.c projects/clangbsd/contrib/binutils/gas/config/tc-mips.c projects/clangbsd/contrib/binutils/gas/config/tc-mips.h projects/clangbsd/contrib/binutils/include/elf/mips.h projects/clangbsd/contrib/binutils/include/opcode/mips.h projects/clangbsd/contrib/binutils/opcodes/mips-dis.c projects/clangbsd/contrib/binutils/opcodes/mips-opc.c projects/clangbsd/contrib/binutils/opcodes/mips16-opc.c projects/clangbsd/contrib/gcc/config/mips/freebsd.h projects/clangbsd/contrib/gcc/config/mips/mips.c projects/clangbsd/contrib/gcc/config/mips/mips.h projects/clangbsd/contrib/gcc/config/mips/mips.md projects/clangbsd/contrib/gdtoa/hexnan.c projects/clangbsd/contrib/sendmail/mail.local/mail.local.8 projects/clangbsd/crypto/openssh/moduli.5 projects/clangbsd/crypto/openssh/scp.1 projects/clangbsd/crypto/openssh/sftp-server.8 projects/clangbsd/crypto/openssh/sftp.1 projects/clangbsd/crypto/openssh/ssh-add.1 projects/clangbsd/crypto/openssh/ssh-agent.1 projects/clangbsd/crypto/openssh/ssh-keygen.1 projects/clangbsd/crypto/openssh/ssh-keyscan.1 projects/clangbsd/crypto/openssh/ssh-keysign.8 projects/clangbsd/crypto/openssh/ssh.1 projects/clangbsd/crypto/openssh/ssh_config.5 projects/clangbsd/crypto/openssh/sshd.8 projects/clangbsd/crypto/openssh/sshd_config.5 projects/clangbsd/games/pom/pom.6 projects/clangbsd/gnu/lib/libgcc/Makefile projects/clangbsd/gnu/lib/libgomp/Makefile projects/clangbsd/gnu/usr.bin/binutils/Makefile.inc0 projects/clangbsd/gnu/usr.bin/binutils/ld/Makefile.mips projects/clangbsd/gnu/usr.bin/binutils/libbfd/Makefile.mips projects/clangbsd/gnu/usr.bin/binutils/libbfd/bfd.h projects/clangbsd/gnu/usr.bin/cc/Makefile.inc projects/clangbsd/lib/libarchive/archive_entry.3 projects/clangbsd/lib/libarchive/archive_read.3 projects/clangbsd/lib/libarchive/archive_read_disk.3 projects/clangbsd/lib/libarchive/archive_util.3 projects/clangbsd/lib/libarchive/archive_write.3 projects/clangbsd/lib/libarchive/archive_write_disk.3 projects/clangbsd/lib/libarchive/libarchive-formats.5 projects/clangbsd/lib/libarchive/tar.5 projects/clangbsd/lib/libc/gen/getcap.3 projects/clangbsd/lib/libc/gen/scandir.3 projects/clangbsd/lib/libc/posix1e/acl_entry.c projects/clangbsd/lib/libc/posix1e/acl_set.c projects/clangbsd/lib/libc/posix1e/acl_strip.c projects/clangbsd/lib/libc/posix1e/acl_support.c projects/clangbsd/lib/libc/posix1e/acl_support.h projects/clangbsd/lib/libc/posix1e/acl_to_text_nfs4.c projects/clangbsd/lib/libc/posix1e/acl_valid.c projects/clangbsd/lib/libc/sys/flock.2 projects/clangbsd/lib/libc/sys/getitimer.2 projects/clangbsd/lib/libc/sys/getrusage.2 projects/clangbsd/lib/libc/sys/mq_close.2 projects/clangbsd/lib/libc/sys/mq_getattr.2 projects/clangbsd/lib/libc/sys/mq_notify.2 projects/clangbsd/lib/libc/sys/mq_open.2 projects/clangbsd/lib/libc/sys/mq_receive.2 projects/clangbsd/lib/libc/sys/mq_send.2 projects/clangbsd/lib/libc/sys/mq_setattr.2 projects/clangbsd/lib/libgssapi/gss_compare_name.3 projects/clangbsd/lib/libpmc/pmc.corei7.3 projects/clangbsd/lib/libpmc/pmc.corei7uc.3 projects/clangbsd/lib/libpmc/pmc.ucf.3 projects/clangbsd/lib/libpmc/pmc.westmereuc.3 projects/clangbsd/lib/libpmc/pmclog.c projects/clangbsd/lib/librpcsec_gss/rpc_gss_seccreate.3 projects/clangbsd/lib/msun/man/atan2.3 projects/clangbsd/lib/msun/man/remainder.3 projects/clangbsd/libexec/rbootd/rbootd.8 projects/clangbsd/libexec/rtld-elf/rtld.c projects/clangbsd/release/doc/en_US.ISO8859-1/relnotes/article.sgml projects/clangbsd/sbin/geom/class/part/geom_part.c projects/clangbsd/sbin/geom/class/part/gpart.8 projects/clangbsd/sbin/geom/misc/subr.c projects/clangbsd/share/man/man1/builtin.1 projects/clangbsd/share/man/man4/Makefile projects/clangbsd/share/man/man4/acpi.4 projects/clangbsd/share/man/man4/ae.4 projects/clangbsd/share/man/man4/io.4 projects/clangbsd/share/man/man4/mpt.4 projects/clangbsd/share/man/man4/textdump.4 projects/clangbsd/share/man/man5/a.out.5 projects/clangbsd/share/man/man5/src.conf.5 projects/clangbsd/share/man/man5/stab.5 projects/clangbsd/share/man/man9/bus_generic_new_pass.9 projects/clangbsd/share/man/man9/bus_set_pass.9 projects/clangbsd/share/man/man9/insmntque.9 projects/clangbsd/share/man/man9/make_dev.9 projects/clangbsd/share/man/man9/vfs_mountedfrom.9 projects/clangbsd/share/misc/committers-src.dot projects/clangbsd/share/mk/bsd.own.mk projects/clangbsd/share/mk/sys.mk projects/clangbsd/share/termcap/termcap.5 projects/clangbsd/sys/amd64/acpica/acpi_wakeup.c projects/clangbsd/sys/amd64/amd64/cpu_switch.S projects/clangbsd/sys/amd64/amd64/fpu.c projects/clangbsd/sys/amd64/amd64/machdep.c projects/clangbsd/sys/amd64/amd64/mp_machdep.c projects/clangbsd/sys/amd64/amd64/pmap.c projects/clangbsd/sys/amd64/amd64/trap.c projects/clangbsd/sys/amd64/amd64/vm_machdep.c projects/clangbsd/sys/amd64/ia32/ia32_reg.c projects/clangbsd/sys/amd64/include/fpu.h projects/clangbsd/sys/amd64/include/pcb.h projects/clangbsd/sys/amd64/linux32/linux32_machdep.c projects/clangbsd/sys/arm/arm/pmap.c projects/clangbsd/sys/boot/pc98/boot0/Makefile projects/clangbsd/sys/boot/sparc64/boot1/Makefile projects/clangbsd/sys/cam/ata/ata_pmp.c projects/clangbsd/sys/cam/ata/ata_xpt.c projects/clangbsd/sys/cam/cam_debug.h projects/clangbsd/sys/cam/cam_periph.c projects/clangbsd/sys/cam/cam_xpt.c projects/clangbsd/sys/cam/cam_xpt_internal.h projects/clangbsd/sys/cam/scsi/scsi_all.c projects/clangbsd/sys/cam/scsi/scsi_all.h projects/clangbsd/sys/cam/scsi/scsi_cd.c projects/clangbsd/sys/cam/scsi/scsi_ch.h projects/clangbsd/sys/cam/scsi/scsi_da.c projects/clangbsd/sys/cam/scsi/scsi_xpt.c projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c projects/clangbsd/sys/conf/NOTES projects/clangbsd/sys/conf/files projects/clangbsd/sys/conf/files.amd64 projects/clangbsd/sys/conf/files.i386 projects/clangbsd/sys/conf/files.pc98 projects/clangbsd/sys/conf/files.powerpc projects/clangbsd/sys/conf/options projects/clangbsd/sys/contrib/libfdt/libfdt_env.h projects/clangbsd/sys/crypto/via/padlock.c projects/clangbsd/sys/crypto/via/padlock.h projects/clangbsd/sys/crypto/via/padlock_cipher.c projects/clangbsd/sys/crypto/via/padlock_hash.c projects/clangbsd/sys/dev/acpica/acpi.c projects/clangbsd/sys/dev/acpica/acpi_ec.c projects/clangbsd/sys/dev/ahci/ahci.c projects/clangbsd/sys/dev/ata/ata-all.h projects/clangbsd/sys/dev/ata/ata-lowlevel.c projects/clangbsd/sys/dev/ata/atapi-cam.c projects/clangbsd/sys/dev/ata/chipsets/ata-acerlabs.c projects/clangbsd/sys/dev/ata/chipsets/ata-intel.c projects/clangbsd/sys/dev/ata/chipsets/ata-serverworks.c projects/clangbsd/sys/dev/ath/ath_hal/ah.h projects/clangbsd/sys/dev/ath/ath_hal/ah_eeprom_v4k.c projects/clangbsd/sys/dev/ath/ath_hal/ah_eeprom_v4k.h projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar5416phy.h projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c projects/clangbsd/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c projects/clangbsd/sys/dev/bge/if_bge.c projects/clangbsd/sys/dev/bge/if_bgereg.h projects/clangbsd/sys/dev/cas/if_cas.c projects/clangbsd/sys/dev/cxgb/cxgb_main.c projects/clangbsd/sys/dev/hwpmc/hwpmc_mod.c projects/clangbsd/sys/dev/iicbus/iic.h projects/clangbsd/sys/dev/isp/isp.c projects/clangbsd/sys/dev/isp/isp_freebsd.c projects/clangbsd/sys/dev/isp/isp_library.c projects/clangbsd/sys/dev/isp/isp_pci.c projects/clangbsd/sys/dev/ixgbe/ixgbe.c projects/clangbsd/sys/dev/ixgbe/ixgbe.h projects/clangbsd/sys/dev/mvs/mvs.c projects/clangbsd/sys/dev/random/nehemiah.c projects/clangbsd/sys/dev/sge/if_sge.c projects/clangbsd/sys/dev/siis/siis.c projects/clangbsd/sys/dev/sound/pci/hda/hdac.c projects/clangbsd/sys/dev/twa/tw_cl.h projects/clangbsd/sys/dev/twa/tw_cl_fwif.h projects/clangbsd/sys/dev/twa/tw_cl_init.c projects/clangbsd/sys/dev/twa/tw_cl_intr.c projects/clangbsd/sys/dev/twa/tw_cl_io.c projects/clangbsd/sys/dev/twa/tw_cl_misc.c projects/clangbsd/sys/dev/twa/tw_cl_share.h projects/clangbsd/sys/dev/twa/tw_osl.h projects/clangbsd/sys/dev/twa/tw_osl_cam.c projects/clangbsd/sys/dev/twa/tw_osl_externs.h projects/clangbsd/sys/dev/twa/tw_osl_freebsd.c projects/clangbsd/sys/dev/twa/tw_osl_inline.h projects/clangbsd/sys/dev/twa/tw_osl_share.h projects/clangbsd/sys/dev/xen/netfront/netfront.c projects/clangbsd/sys/fs/devfs/devfs.h projects/clangbsd/sys/fs/devfs/devfs_devs.c projects/clangbsd/sys/fs/devfs/devfs_vnops.c projects/clangbsd/sys/geom/geom_event.c projects/clangbsd/sys/geom/geom_io.c projects/clangbsd/sys/geom/mountver/g_mountver.c projects/clangbsd/sys/geom/part/g_part_bsd.c projects/clangbsd/sys/geom/part/g_part_gpt.c projects/clangbsd/sys/i386/i386/machdep.c projects/clangbsd/sys/i386/i386/pmap.c projects/clangbsd/sys/i386/i386/ptrace_machdep.c projects/clangbsd/sys/i386/i386/swtch.s projects/clangbsd/sys/i386/i386/trap.c projects/clangbsd/sys/i386/i386/vm_machdep.c projects/clangbsd/sys/i386/include/npx.h projects/clangbsd/sys/i386/include/pcb.h projects/clangbsd/sys/i386/include/pcpu.h projects/clangbsd/sys/i386/isa/npx.c projects/clangbsd/sys/i386/linux/linux_machdep.c projects/clangbsd/sys/i386/linux/linux_ptrace.c projects/clangbsd/sys/i386/xen/pmap.c projects/clangbsd/sys/ia64/ia64/busdma_machdep.c projects/clangbsd/sys/ia64/ia64/pmap.c projects/clangbsd/sys/ia64/ia64/vm_machdep.c projects/clangbsd/sys/ia64/include/md_var.h projects/clangbsd/sys/kern/kern_intr.c projects/clangbsd/sys/kern/kern_jail.c projects/clangbsd/sys/kern/kern_sx.c projects/clangbsd/sys/kern/posix4_mib.c projects/clangbsd/sys/kern/sched_4bsd.c projects/clangbsd/sys/kern/sched_ule.c projects/clangbsd/sys/kern/subr_acl_nfs4.c projects/clangbsd/sys/kern/subr_acl_posix1e.c projects/clangbsd/sys/kern/subr_bus.c projects/clangbsd/sys/kern/subr_taskqueue.c projects/clangbsd/sys/kern/sysv_sem.c projects/clangbsd/sys/kern/sysv_shm.c projects/clangbsd/sys/kern/uipc_sem.c projects/clangbsd/sys/kern/uipc_shm.c projects/clangbsd/sys/kern/vfs_acl.c projects/clangbsd/sys/kern/vfs_bio.c projects/clangbsd/sys/kern/vfs_subr.c projects/clangbsd/sys/mips/mips/pmap.c projects/clangbsd/sys/modules/netgraph/Makefile projects/clangbsd/sys/modules/zfs/Makefile projects/clangbsd/sys/net/vnet.h projects/clangbsd/sys/net80211/ieee80211_hwmp.c projects/clangbsd/sys/net80211/ieee80211_ioctl.c projects/clangbsd/sys/net80211/ieee80211_scan_sta.c projects/clangbsd/sys/net80211/ieee80211_sta.c projects/clangbsd/sys/netgraph/ng_pppoe.c projects/clangbsd/sys/netinet/ip_mroute.c projects/clangbsd/sys/netinet/ip_mroute.h projects/clangbsd/sys/netinet/pim_var.h projects/clangbsd/sys/netinet/sctp_auth.c projects/clangbsd/sys/netinet/sctp_bsd_addr.c projects/clangbsd/sys/netinet/sctp_constants.h projects/clangbsd/sys/netinet/sctp_indata.c projects/clangbsd/sys/netinet/sctp_input.c projects/clangbsd/sys/netinet/sctp_lock_bsd.h projects/clangbsd/sys/netinet/sctp_output.c projects/clangbsd/sys/netinet/sctp_pcb.c projects/clangbsd/sys/netinet/sctp_pcb.h projects/clangbsd/sys/netinet/sctp_sysctl.c projects/clangbsd/sys/netinet/sctp_usrreq.c projects/clangbsd/sys/netinet/sctputil.c projects/clangbsd/sys/opencrypto/crypto.c projects/clangbsd/sys/pc98/pc98/machdep.c projects/clangbsd/sys/powerpc/aim/mmu_oea.c projects/clangbsd/sys/powerpc/aim/mmu_oea64.c projects/clangbsd/sys/powerpc/booke/pmap.c projects/clangbsd/sys/powerpc/powermac/kiic.c projects/clangbsd/sys/powerpc/powermac/macgpio.c projects/clangbsd/sys/powerpc/powermac/smu.c projects/clangbsd/sys/powerpc/powermac/uninorth.c projects/clangbsd/sys/powerpc/powerpc/intr_machdep.c projects/clangbsd/sys/sparc64/sparc64/pmap.c projects/clangbsd/sys/sun4v/sun4v/pmap.c projects/clangbsd/sys/sys/_task.h projects/clangbsd/sys/sys/libkern.h projects/clangbsd/sys/sys/nlist_aout.h projects/clangbsd/sys/sys/param.h projects/clangbsd/sys/sys/pmc.h projects/clangbsd/sys/sys/posix4.h projects/clangbsd/sys/sys/proc.h projects/clangbsd/sys/sys/vtoc.h projects/clangbsd/sys/ufs/ufs/ufs_quota.c projects/clangbsd/sys/vm/vm_contig.c projects/clangbsd/sys/vm/vm_page.c projects/clangbsd/sys/vm/vm_page.h projects/clangbsd/sys/vm/vm_pageout.c projects/clangbsd/sys/vm/vm_pageout.h projects/clangbsd/sys/vm/vnode_pager.c projects/clangbsd/tools/regression/fstest/Makefile projects/clangbsd/tools/regression/usr.bin/jot/regress.sh projects/clangbsd/tools/tools/netrate/tcpp/README projects/clangbsd/tools/tools/netrate/tcpp/tcpp.c projects/clangbsd/tools/tools/netrate/tcpp/tcpp.h projects/clangbsd/tools/tools/netrate/tcpp/tcpp_client.c projects/clangbsd/tools/tools/netrate/tcpp/tcpp_server.c projects/clangbsd/usr.bin/bc/scan.l projects/clangbsd/usr.bin/calendar/calendars/calendar.freebsd projects/clangbsd/usr.bin/calendar/io.c projects/clangbsd/usr.bin/calendar/locale.c projects/clangbsd/usr.bin/calendar/sunpos.c projects/clangbsd/usr.bin/dc/bcode.c projects/clangbsd/usr.bin/dc/dc.c projects/clangbsd/usr.bin/gzip/gzip.c projects/clangbsd/usr.bin/hexdump/od.1 projects/clangbsd/usr.bin/ipcs/ipc.c projects/clangbsd/usr.bin/join/join.1 projects/clangbsd/usr.bin/jot/jot.1 projects/clangbsd/usr.bin/jot/jot.c projects/clangbsd/usr.bin/newkey/newkey.8 projects/clangbsd/usr.bin/unzip/unzip.c projects/clangbsd/usr.sbin/chown/chown.c projects/clangbsd/usr.sbin/nfscbd/nfscbd.8 projects/clangbsd/usr.sbin/nfsdumpstate/nfsdumpstate.8 projects/clangbsd/usr.sbin/pmcstat/pmcpl_calltree.c projects/clangbsd/usr.sbin/pmcstat/pmcstat.c projects/clangbsd/usr.sbin/pmcstat/pmcstat_log.c projects/clangbsd/usr.sbin/service/service.8 projects/clangbsd/usr.sbin/sysinstall/tcpip.c projects/clangbsd/usr.sbin/timed/timed/timed.8 projects/clangbsd/usr.sbin/tzsetup/tzsetup.c Directory Properties: projects/clangbsd/ (props changed) projects/clangbsd/cddl/contrib/opensolaris/ (props changed) projects/clangbsd/contrib/bind9/ (props changed) projects/clangbsd/contrib/ee/ (props changed) projects/clangbsd/contrib/expat/ (props changed) projects/clangbsd/contrib/file/ (props changed) projects/clangbsd/contrib/gdb/ (props changed) projects/clangbsd/contrib/gdtoa/ (props changed) projects/clangbsd/contrib/gnu-sort/ (props changed) projects/clangbsd/contrib/groff/ (props changed) projects/clangbsd/contrib/less/ (props changed) projects/clangbsd/contrib/libpcap/ (props changed) projects/clangbsd/contrib/llvm/ (props changed) projects/clangbsd/contrib/llvm/tools/clang/ (props changed) projects/clangbsd/contrib/ncurses/ (props changed) projects/clangbsd/contrib/netcat/ (props changed) projects/clangbsd/contrib/ntp/ (props changed) projects/clangbsd/contrib/one-true-awk/ (props changed) projects/clangbsd/contrib/openbsm/ (props changed) projects/clangbsd/contrib/openpam/ (props changed) projects/clangbsd/contrib/pf/ (props changed) projects/clangbsd/contrib/sendmail/ (props changed) projects/clangbsd/contrib/tcpdump/ (props changed) projects/clangbsd/contrib/tcsh/ (props changed) projects/clangbsd/contrib/top/ (props changed) projects/clangbsd/contrib/top/install-sh (props changed) projects/clangbsd/contrib/tzcode/stdtime/ (props changed) projects/clangbsd/contrib/tzcode/zic/ (props changed) projects/clangbsd/contrib/tzdata/ (props changed) projects/clangbsd/contrib/wpa/ (props changed) projects/clangbsd/crypto/openssh/ (props changed) projects/clangbsd/crypto/openssl/ (props changed) projects/clangbsd/lib/libc/ (props changed) projects/clangbsd/lib/libc/stdtime/ (props changed) projects/clangbsd/lib/libutil/ (props changed) projects/clangbsd/lib/libz/ (props changed) projects/clangbsd/sbin/ (props changed) projects/clangbsd/sbin/ipfw/ (props changed) projects/clangbsd/share/zoneinfo/ (props changed) projects/clangbsd/sys/ (props changed) projects/clangbsd/sys/amd64/include/xen/ (props changed) projects/clangbsd/sys/cddl/contrib/opensolaris/ (props changed) projects/clangbsd/sys/contrib/dev/acpica/ (props changed) projects/clangbsd/sys/contrib/pf/ (props changed) projects/clangbsd/sys/contrib/x86emu/ (props changed) projects/clangbsd/sys/dev/xen/xenpci/ (props changed) projects/clangbsd/usr.bin/csup/ (props changed) projects/clangbsd/usr.bin/procstat/ (props changed) projects/clangbsd/usr.sbin/zic/ (props changed) Modified: projects/clangbsd/Makefile.inc1 ============================================================================== --- projects/clangbsd/Makefile.inc1 Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/Makefile.inc1 Fri Jun 11 13:10:32 2010 (r209040) @@ -967,12 +967,12 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${MK_CLANG} != "no" +# XXX: There is no way to specify bootstrap tools depending on MK-flags +# with different per-architecture default values. Always build tblgen. _clang_tblgen= \ lib/clang/libllvmsupport \ lib/clang/libllvmsystem \ usr.bin/clang/tblgen -.endif .if ${MK_CDDL} != "no" _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ Modified: projects/clangbsd/bin/chio/chio.c ============================================================================== --- projects/clangbsd/bin/chio/chio.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/chio/chio.c Fri Jun 11 13:10:32 2010 (r209040) @@ -1072,6 +1072,7 @@ find_element(char *voltag, uint16_t *et, /* Read in the changer slots */ if (cp.cp_nslots > 0) { + (void) memset(&cesr, 0, sizeof(cesr)); cesr.cesr_element_type = CHET_ST; cesr.cesr_element_base = 0; cesr.cesr_element_count = cp.cp_nslots; Modified: projects/clangbsd/bin/cp/cp.c ============================================================================== --- projects/clangbsd/bin/cp/cp.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/cp/cp.c Fri Jun 11 13:10:32 2010 (r209040) @@ -466,6 +466,7 @@ copy(char *argv[], enum op type, int fts case S_IFSOCK: warnx("%s is a socket (not copied).", curr->fts_path); + break; case S_IFIFO: if (Rflag) { if (copy_fifo(curr->fts_statp, !dne)) Modified: projects/clangbsd/bin/date/date.1 ============================================================================== --- projects/clangbsd/bin/date/date.1 Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/date/date.1 Fri Jun 11 13:10:32 2010 (r209040) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 2, 2007 +.Dd June 3, 2010 .Dt DATE 1 .Os .Sh NAME @@ -219,6 +219,14 @@ When the date is adjusted to a specific the resulting timezone will be set so that the date matches the earlier of the two times. .Pp +It is not possible to adjust a date to an invalid absolute day, so using +the switches +.Fl v No 31d Fl v No 12m +will simply fail five months of the year. +It is therefore usual to set the month before setting the day; using +.Fl v No 12m Fl v No 31d +always works. +.Pp Adjusting the date by months is inherently ambiguous because a month is a unit of variable length depending on the current date. This kind of date adjustment is applied in the most intuitive way. @@ -339,9 +347,9 @@ will display the last day of February in .Pp .Dl "Tue Feb 29 03:18:00 GMT 2000" .Pp -So will do the command: +So will the command: .Pp -.Dl "date -v30d -v3m -v0y -v-1m" +.Dl "date -v3m -v30d -v0y -v-1m" .Pp because there is no such date as the 30th of February. .Pp Modified: projects/clangbsd/bin/getfacl/getfacl.1 ============================================================================== --- projects/clangbsd/bin/getfacl/getfacl.1 Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/getfacl/getfacl.1 Fri Jun 11 13:10:32 2010 (r209040) @@ -48,7 +48,7 @@ the specified file(s) to standard output If the .Xr getconf 1 utility indicates that -.Eq { } Va _POSIX_ACL_EXTENDED +.Brq Va _POSIX_ACL_EXTENDED is not in effect for a .Ar file then the standard discretionary access permissions are interpreted as Modified: projects/clangbsd/bin/sh/histedit.c ============================================================================== --- projects/clangbsd/bin/sh/histedit.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/sh/histedit.c Fri Jun 11 13:10:32 2010 (r209040) @@ -98,6 +98,8 @@ histedit(void) /* * turn editing on */ + char *term; + INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); @@ -107,6 +109,11 @@ histedit(void) el_out = fdopen(2, "w"); if (el_in == NULL || el_err == NULL || el_out == NULL) goto bad; + term = lookupvar("TERM"); + if (term) + setenv("TERM", term, 1); + else + unsetenv("TERM"); el = el_init(arg0, el_in, el_out, el_err); if (el != NULL) { if (hist) @@ -160,6 +167,13 @@ sethistsize(hs) } } +void +setterm(const char *term) +{ + if (rootshell && el != NULL && term != NULL) + el_set(el, EL_TERMINAL, term); +} + int histcmd(int argc, char **argv) { Modified: projects/clangbsd/bin/sh/jobs.c ============================================================================== --- projects/clangbsd/bin/sh/jobs.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/sh/jobs.c Fri Jun 11 13:10:32 2010 (r209040) @@ -866,6 +866,7 @@ waitforjob(struct job *jp, int *origstat { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -903,6 +904,11 @@ waitforjob(struct job *jp, int *origstat else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } Modified: projects/clangbsd/bin/sh/myhistedit.h ============================================================================== --- projects/clangbsd/bin/sh/myhistedit.h Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/sh/myhistedit.h Fri Jun 11 13:10:32 2010 (r209040) @@ -38,6 +38,7 @@ extern int displayhist; void histedit(void); void sethistsize(const char *); +void setterm(const char *); int histcmd(int, char **); int not_fcnumber(const char *); int str_to_event(const char *, int); Modified: projects/clangbsd/bin/sh/var.c ============================================================================== --- projects/clangbsd/bin/sh/var.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/sh/var.c Fri Jun 11 13:10:32 2010 (r209040) @@ -80,6 +80,7 @@ struct varinit { #ifndef NO_HISTORY struct var vhistsize; +struct var vterm; #endif struct var vifs; struct var vmail; @@ -114,6 +115,10 @@ STATIC const struct varinit varinit[] = NULL }, { &vps4, 0, "PS4=+ ", NULL }, +#ifndef NO_HISTORY + { &vterm, VUNSET, "TERM=", + setterm }, +#endif { &voptind, 0, "OPTIND=1", getoptsreset }, { NULL, 0, NULL, Modified: projects/clangbsd/bin/sh/var.h ============================================================================== --- projects/clangbsd/bin/sh/var.h Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/bin/sh/var.h Fri Jun 11 13:10:32 2010 (r209040) @@ -77,6 +77,7 @@ extern struct var vps2; extern struct var vps4; #ifndef NO_HISTORY extern struct var vhistsize; +extern struct var vterm; #endif /* @@ -96,6 +97,7 @@ extern struct var vhistsize; #define optindval() (voptind.text + 7) #ifndef NO_HISTORY #define histsizeval() (vhistsize.text + 9) +#define termval() (vterm.text + 5) #endif #define mpathset() ((vmpath.flags & VUNSET) == 0) Modified: projects/clangbsd/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- projects/clangbsd/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 11 13:10:32 2010 (r209040) @@ -811,7 +811,8 @@ id_or_type(const char *s) longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); } - unput(c0); + if (c0 != EOF) + unput(c0); return (ttok); } Modified: projects/clangbsd/contrib/binutils/bfd/archures.c ============================================================================== --- projects/clangbsd/contrib/binutils/bfd/archures.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/contrib/binutils/bfd/archures.c Fri Jun 11 13:10:32 2010 (r209040) @@ -1,6 +1,6 @@ /* BFD library support routines for architectures. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. @@ -18,7 +18,7 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -141,10 +141,12 @@ DESCRIPTION .#define bfd_mach_mips6000 6000 .#define bfd_mach_mips7000 7000 .#define bfd_mach_mips8000 8000 +.#define bfd_mach_mips9000 9000 .#define bfd_mach_mips10000 10000 .#define bfd_mach_mips12000 12000 .#define bfd_mach_mips16 16 .#define bfd_mach_mips5 5 +.#define bfd_mach_mips_octeon 6502 .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} .#define bfd_mach_mipsisa32 32 .#define bfd_mach_mipsisa32r2 33 Modified: projects/clangbsd/contrib/binutils/bfd/bfd-in2.h ============================================================================== --- projects/clangbsd/contrib/binutils/bfd/bfd-in2.h Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/contrib/binutils/bfd/bfd-in2.h Fri Jun 11 13:10:32 2010 (r209040) @@ -8,7 +8,8 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -26,7 +27,7 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ Modified: projects/clangbsd/contrib/binutils/bfd/cpu-mips.c ============================================================================== --- projects/clangbsd/contrib/binutils/bfd/cpu-mips.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/contrib/binutils/bfd/cpu-mips.c Fri Jun 11 13:10:32 2010 (r209040) @@ -1,6 +1,6 @@ /* bfd back-end for mips support Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. + 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,7 @@ GNU General Public License for more deta 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -76,6 +76,7 @@ enum I_mips6000, I_mips7000, I_mips8000, + I_mips9000, I_mips10000, I_mips12000, I_mips16, @@ -84,6 +85,7 @@ enum I_mipsisa32r2, I_mipsisa64, I_mipsisa64r2, + I_mipsocteon, I_sb1, }; @@ -108,6 +110,7 @@ static const bfd_arch_info_type arch_inf N (32, 32, bfd_mach_mips6000, "mips:6000", FALSE, NN(I_mips6000)), N (64, 64, bfd_mach_mips7000, "mips:7000", FALSE, NN(I_mips7000)), N (64, 64, bfd_mach_mips8000, "mips:8000", FALSE, NN(I_mips8000)), + N (64, 64, bfd_mach_mips9000, "mips:9000", FALSE, NN(I_mips9000)), N (64, 64, bfd_mach_mips10000,"mips:10000", FALSE, NN(I_mips10000)), N (64, 64, bfd_mach_mips12000,"mips:12000", FALSE, NN(I_mips12000)), N (64, 64, bfd_mach_mips16, "mips:16", FALSE, NN(I_mips16)), @@ -116,6 +119,7 @@ static const bfd_arch_info_type arch_inf N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)), N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), + N (64, 64, bfd_mach_mips_octeon,"mips:octeon", FALSE, NN(I_mipsocteon)), N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0), }; Modified: projects/clangbsd/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- projects/clangbsd/contrib/binutils/bfd/elfxx-mips.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/contrib/binutils/bfd/elfxx-mips.c Fri Jun 11 13:10:32 2010 (r209040) @@ -1,6 +1,6 @@ /* MIPS-specific support for ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -23,7 +23,7 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file handles functionality common to the different MIPS ABI's. */ @@ -4088,6 +4088,12 @@ _bfd_elf_mips_mach (flagword flags) case E_MIPS_MACH_5500: return bfd_mach_mips5500; + case E_MIPS_MACH_9000: + return bfd_mach_mips9000; + + case E_MIPS_MACH_OCTEON: + return bfd_mach_mips_octeon; + case E_MIPS_MACH_SB1: return bfd_mach_mips_sb1; @@ -7142,6 +7148,10 @@ mips_set_isa_flags (bfd *abfd) val = E_MIPS_ARCH_4 | E_MIPS_MACH_5500; break; + case bfd_mach_mips9000: + val = E_MIPS_ARCH_4 | E_MIPS_MACH_9000; + break; + case bfd_mach_mips5000: case bfd_mach_mips7000: case bfd_mach_mips8000: @@ -7154,6 +7164,10 @@ mips_set_isa_flags (bfd *abfd) val = E_MIPS_ARCH_5; break; + case bfd_mach_mips_octeon: + val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON; + break; + case bfd_mach_mips_sb1: val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; break; @@ -8856,6 +8870,9 @@ struct mips_mach_extension { are ordered topologically with MIPS I extensions listed last. */ static const struct mips_mach_extension mips_mach_extensions[] = { + /* MIPS64r2 extensions. */ + { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 }, + /* MIPS64 extensions. */ { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 }, { bfd_mach_mips_sb1, bfd_mach_mipsisa64 }, @@ -8879,6 +8896,7 @@ static const struct mips_mach_extension { bfd_mach_mips10000, bfd_mach_mips8000 }, { bfd_mach_mips5000, bfd_mach_mips8000 }, { bfd_mach_mips7000, bfd_mach_mips8000 }, + { bfd_mach_mips9000, bfd_mach_mips8000 }, /* VR4100 extensions. */ { bfd_mach_mips4120, bfd_mach_mips4100 }, @@ -8913,11 +8931,26 @@ mips_mach_extends_p (unsigned long base, { size_t i; - for (i = 0; extension != base && i < ARRAY_SIZE (mips_mach_extensions); i++) + if (extension == base) + return TRUE; + + if (base == bfd_mach_mipsisa32 + && mips_mach_extends_p (bfd_mach_mipsisa64, extension)) + return TRUE; + + if (base == bfd_mach_mipsisa32r2 + && mips_mach_extends_p (bfd_mach_mipsisa64r2, extension)) + return TRUE; + + for (i = 0; i < ARRAY_SIZE (mips_mach_extensions); i++) if (extension == mips_mach_extensions[i].extension) - extension = mips_mach_extensions[i].base; + { + extension = mips_mach_extensions[i].base; + if (extension == base) + return TRUE; + } - return extension == base; + return FALSE; } Modified: projects/clangbsd/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- projects/clangbsd/contrib/binutils/gas/config/tc-mips.c Fri Jun 11 12:58:29 2010 (r209039) +++ projects/clangbsd/contrib/binutils/gas/config/tc-mips.c Fri Jun 11 13:10:32 2010 (r209040) @@ -1,6 +1,6 @@ /* tc-mips.c -- assemble code for a MIPS chip. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus @@ -20,8 +20,8 @@ You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "as.h" #include "config.h" @@ -33,6 +33,7 @@ #include "opcode/mips.h" #include "itbl-ops.h" #include "dwarf2dbg.h" +#include "dw2gencfi.h" #ifdef DEBUG #define DBG(x) printf x @@ -83,6 +84,25 @@ int mips_flag_pdr = FALSE; int mips_flag_pdr = TRUE; #endif +/* Control generation of error message for unsupported instructions in + Octeon. Octeon does not have floating point, and all the instructions + that use floating point registers are not allowed in Elf targets but + are allowed in Linux targets by default. */ +#ifdef OCTEON_ERROR_ON_UNSUPPORTED +static int octeon_error_on_unsupported = 1; +#else +static int octeon_error_on_unsupported = 0; +#endif + +/* Control generation of Octeon/MIPS unaligned load/store instructions. + For ELF target, default to Octeon load/store instructions. + For Linux target, default to MIPS load/store instructions. */ +#ifdef OCTEON_USE_UNALIGN +static int octeon_use_unalign = 1; +#else +static int octeon_use_unalign = 0; +#endif + #include "ecoff.h" #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) @@ -111,9 +131,7 @@ static char *mips_regmask_frag; extern int target_big_endian; /* The name of the readonly data section. */ -#define RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_aout_flavour \ - ? ".data" \ - : OUTPUT_FLAVOR == bfd_target_ecoff_flavour \ +#define RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_ecoff_flavour \ ? ".rdata" \ : OUTPUT_FLAVOR == bfd_target_coff_flavour \ ? ".rdata" \ @@ -121,6 +139,43 @@ extern int target_big_endian; ? ".rodata" \ : (abort (), "")) +/* Information about an instruction, including its format, operands + and fixups. */ +struct mips_cl_insn +{ + /* The opcode's entry in mips_opcodes or mips16_opcodes. */ + const struct mips_opcode *insn_mo; + + /* True if this is a mips16 instruction and if we want the extended + form of INSN_MO. */ + bfd_boolean use_extend; + + /* The 16-bit extension instruction to use when USE_EXTEND is true. */ + unsigned short extend; + + /* The 16-bit or 32-bit bitstring of the instruction itself. This is + a copy of INSN_MO->match with the operands filled in. */ + unsigned long insn_opcode; + + /* The frag that contains the instruction. */ + struct frag *frag; + + /* The offset into FRAG of the first instruction byte. */ + long where; + + /* The relocs associated with the instruction, if any. */ + fixS *fixp[3]; + + /* True if this entry cannot be moved from its current position. */ + unsigned int fixed_p : 1; + + /* True if this instruction occured in a .set noreorder block. */ + unsigned int noreorder_p : 1; + + /* True for mips16 instructions that jump to an absolute address. */ + unsigned int mips16_absolute_jump_p : 1; +}; + /* The ABI to use. */ enum mips_abi_level { @@ -138,6 +193,10 @@ static enum mips_abi_level mips_abi = NO /* Whether or not we have code that can call pic code. */ int mips_abicalls = FALSE; +/* Whether or not we have code which can be put into a shared + library. */ +static bfd_boolean mips_in_shared = TRUE; + /* This is the set of options which may be modified by the .set pseudo-op. We use a struct so that .set push and .set pop are more reliable. */ @@ -153,6 +212,8 @@ struct mips_set_options command line options, and based on the default architecture. */ int ase_mips3d; int ase_mdmx; + int ase_dsp; + int ase_mt; /* Whether we are assembling for the mips16 processor. 0 if we are not, 1 if we are, and -1 if the value has not been initialized. Changed by `.set mips16' and `.set nomips16', and the -mips16 and @@ -187,6 +248,8 @@ struct mips_set_options /* MIPS architecture (CPU) type. Changed by .set arch=FOO, the -march command line option, and the default CPU. */ int arch; + /* True if ".set sym32" is in effect. */ + bfd_boolean sym32; }; /* True if -mgp32 was passed. */ @@ -201,7 +264,7 @@ static int file_mips_fp32 = -1; static struct mips_set_options mips_opts = { - ISA_UNKNOWN, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN + ISA_UNKNOWN, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN, FALSE }; /* These variables are filled in with the masks of registers used. @@ -225,6 +288,14 @@ static int file_ase_mips3d; command line (e.g., by -march). */ static int file_ase_mdmx; +/* True if -mdsp was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_dsp; + +/* True if -mmt was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_mt; + /* The argument of the -march= flag. The architecture we are assembling. */ static int file_mips_arch = CPU_UNKNOWN; static const char *mips_arch_string; @@ -268,6 +339,12 @@ static int mips_32bitmode = 0; || (ISA) == ISA_MIPS64R2 \ ) +/* Return true if ISA supports ins instructions. */ +#define ISA_HAS_INS(ISA) ( \ + (ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2 \ + ) + #define HAVE_32BIT_GPRS \ (mips_opts.gp32 || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) @@ -284,15 +361,16 @@ static int mips_32bitmode = 0; /* True if relocations are stored in-place. */ #define HAVE_IN_PLACE_ADDENDS (!HAVE_NEWABI) -/* We can only have 64bit addresses if the object file format - supports it. */ -#define HAVE_32BIT_ADDRESSES \ - (HAVE_32BIT_GPRS \ - || ((bfd_arch_bits_per_address (stdoutput) == 32 \ - || ! HAVE_64BIT_OBJECTS) \ - && mips_pic != EMBEDDED_PIC)) - -#define HAVE_64BIT_ADDRESSES (! HAVE_32BIT_ADDRESSES) +/* The ABI-derived address size. */ +#define HAVE_64BIT_ADDRESSES \ + (HAVE_64BIT_GPRS && (mips_abi == EABI_ABI || mips_abi == N64_ABI)) +#define HAVE_32BIT_ADDRESSES (!HAVE_64BIT_ADDRESSES) + +/* The size of symbolic constants (i.e., expressions of the form + "SYMBOL" or "SYMBOL + OFFSET"). */ +#define HAVE_32BIT_SYMBOLS \ + (HAVE_32BIT_ADDRESSES || !HAVE_64BIT_OBJECTS || mips_opts.sym32) +#define HAVE_64BIT_SYMBOLS (!HAVE_32BIT_SYMBOLS) /* Addresses are loaded in different ways, depending on the address size in use. The n32 ABI Documentation also mandates the use of additions @@ -322,6 +400,14 @@ static int mips_32bitmode = 0; #define CPU_HAS_MDMX(cpu) (FALSE \ ) +/* Return true if the given CPU supports the DSP ASE. */ +#define CPU_HAS_DSP(cpu) (FALSE \ + ) + +/* Return true if the given CPU supports the MT ASE. */ +#define CPU_HAS_MT(cpu) (FALSE \ + ) + /* True if CPU has a dror instruction. */ #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500) @@ -349,7 +435,6 @@ static int mips_32bitmode = 0; || mips_opts.arch == CPU_R10000 \ || mips_opts.arch == CPU_R12000 \ || mips_opts.arch == CPU_RM7000 \ - || mips_opts.arch == CPU_SB1 \ || mips_opts.arch == CPU_VR5500 \ ) @@ -360,8 +445,6 @@ static int mips_32bitmode = 0; level I. */ #define gpr_interlocks \ (mips_opts.isa != ISA_MIPS1 \ - || mips_opts.arch == CPU_VR5400 \ - || mips_opts.arch == CPU_VR5500 \ || mips_opts.arch == CPU_R3900) /* Whether the processor uses hardware interlocks to avoid delays @@ -377,9 +460,6 @@ static int mips_32bitmode = 0; && mips_opts.isa != ISA_MIPS2 \ && mips_opts.isa != ISA_MIPS3) \ || mips_opts.arch == CPU_R4300 \ - || mips_opts.arch == CPU_VR5400 \ - || mips_opts.arch == CPU_VR5500 \ - || mips_opts.arch == CPU_SB1 \ ) /* Whether the processor uses hardware interlocks to protect reads @@ -521,44 +601,27 @@ static int mips_optimize = 2; equivalent to seeing no -g option at all. */ static int mips_debug = 0; -/* The previous instruction. */ -static struct mips_cl_insn prev_insn; - -/* The instruction before prev_insn. */ -static struct mips_cl_insn prev_prev_insn; +/* The maximum number of NOPs needed to avoid the VR4130 mflo/mfhi errata. */ +#define MAX_VR4130_NOPS 4 -/* If we don't want information for prev_insn or prev_prev_insn, we - point the insn_mo field at this dummy integer. */ -static const struct mips_opcode dummy_opcode = { NULL, NULL, 0, 0, 0, 0 }; +/* The maximum number of NOPs needed to fill delay slots. */ +#define MAX_DELAY_NOPS 2 -/* Non-zero if prev_insn is valid. */ -static int prev_insn_valid; +/* The maximum number of NOPs needed for any purpose. */ +#define MAX_NOPS 4 -/* The frag for the previous instruction. */ -static struct frag *prev_insn_frag; +/* A list of previous instructions, with index 0 being the most recent. + We need to look back MAX_NOPS instructions when filling delay slots + or working around processor errata. We need to look back one + instruction further if we're thinking about using history[0] to + fill a branch delay slot. */ +static struct mips_cl_insn history[1 + MAX_NOPS]; -/* The offset into prev_insn_frag for the previous instruction. */ -static long prev_insn_where; +/* Nop instructions used by emit_nop. */ +static struct mips_cl_insn nop_insn, mips16_nop_insn; -/* The reloc type for the previous instruction, if any. */ -static bfd_reloc_code_real_type prev_insn_reloc_type[3]; - -/* The reloc for the previous instruction, if any. */ -static fixS *prev_insn_fixp[3]; - -/* Non-zero if the previous instruction was in a delay slot. */ -static int prev_insn_is_delay_slot; - -/* Non-zero if the previous instruction was in a .set noreorder. */ -static int prev_insn_unreordered; - -/* Non-zero if the previous instruction uses an extend opcode (if - mips16). */ -static int prev_insn_extended; - -/* Non-zero if the previous previous instruction was in a .set - noreorder. */ -static int prev_prev_insn_unreordered; +/* The appropriate nop for the current mode. */ +#define NOP_INSN (mips_opts.mips16 ? &mips16_nop_insn : &nop_insn) /* If this is set, it points to a frag holding nop instructions which were inserted before the start of a noreorder section. If those @@ -625,8 +688,29 @@ static const unsigned int mips16_to_32_r 16, 17, 2, 3, 4, 5, 6, 7 }; +/* Classifies the kind of instructions we're interested in when + implementing -mfix-vr4120. */ +enum fix_vr4120_class { + FIX_VR4120_MACC, + FIX_VR4120_DMACC, + FIX_VR4120_MULT, + FIX_VR4120_DMULT, + FIX_VR4120_DIV, + FIX_VR4120_MTHILO, + NUM_FIX_VR4120_CLASSES +}; + +/* Given two FIX_VR4120_* values X and Y, bit Y of element X is set if + there must be at least one other instruction between an instruction + of type X and an instruction of type Y. */ +static unsigned int vr4120_conflicts[NUM_FIX_VR4120_CLASSES]; + +/* True if -mfix-vr4120 is in force. */ static int mips_fix_vr4120; +/* ...likewise -mfix-vr4130. */ +static int mips_fix_vr4130; + /* We don't relax branches by default, since this causes us to expand `la .l2 - .l1' if there's a branch between .l1 and .l2, because we fail to compute the offset before expanding the macro to the most @@ -820,6 +904,41 @@ static int mips_relax_branch; (((x) &~ (offsetT) 0x7fff) == 0 \ || (((x) &~ (offsetT) 0x7fff) == ~ (offsetT) 0x7fff)) +/* Is the given value a zero-extended 32-bit value? Or a negated one? */ +#define IS_ZEXT_32BIT_NUM(x) \ + (((x) &~ (offsetT) 0xffffffff) == 0 \ + || (((x) &~ (offsetT) 0xffffffff) == ~ (offsetT) 0xffffffff)) + +/* Replace bits MASK << SHIFT of STRUCT with the equivalent bits in + VALUE << SHIFT. VALUE is evaluated exactly once. */ +#define INSERT_BITS(STRUCT, VALUE, MASK, SHIFT) \ + (STRUCT) = (((STRUCT) & ~((MASK) << (SHIFT))) \ + | (((VALUE) & (MASK)) << (SHIFT))) + +/* Extract bits MASK << SHIFT from STRUCT and shift them right + SHIFT places. */ +#define EXTRACT_BITS(STRUCT, MASK, SHIFT) \ + (((STRUCT) >> (SHIFT)) & (MASK)) + +/* Change INSN's opcode so that the operand given by FIELD has value VALUE. + INSN is a mips_cl_insn structure and VALUE is evaluated exactly once. + + include/opcode/mips.h specifies operand fields using the macros + OP_MASK_ and OP_SH_. The MIPS16 equivalents start + with "MIPS16OP" instead of "OP". */ +#define INSERT_OPERAND(FIELD, INSN, VALUE) \ + INSERT_BITS ((INSN).insn_opcode, VALUE, OP_MASK_##FIELD, OP_SH_##FIELD) +#define MIPS16_INSERT_OPERAND(FIELD, INSN, VALUE) \ + INSERT_BITS ((INSN).insn_opcode, VALUE, \ + MIPS16OP_MASK_##FIELD, MIPS16OP_SH_##FIELD) + +/* Extract the operand given by FIELD from mips_cl_insn INSN. */ +#define EXTRACT_OPERAND(FIELD, INSN) \ + EXTRACT_BITS ((INSN).insn_opcode, OP_MASK_##FIELD, OP_SH_##FIELD) +#define MIPS16_EXTRACT_OPERAND(FIELD, INSN) \ + EXTRACT_BITS ((INSN).insn_opcode, \ + MIPS16OP_MASK_##FIELD, \ + MIPS16OP_SH_##FIELD) /* Global variables used when generating relaxable macros. See the comment above RELAX_ENCODE for more details about how relaxation @@ -866,7 +985,7 @@ enum mips_regclass { MIPS_GR_REG, MIPS_F static void append_insn (struct mips_cl_insn *ip, expressionS *p, bfd_reloc_code_real_type *r); -static void mips_no_prev_insn (int); +static void mips_no_prev_insn (void); static void mips16_macro_build (expressionS *, const char *, const char *, va_list); static void load_register (int, expressionS *, int); @@ -1092,8 +1211,6 @@ mips_target_format (void) { switch (OUTPUT_FLAVOR) { - case bfd_target_aout_flavour: - return target_big_endian ? "a.out-mips-big" : "a.out-mips-little"; case bfd_target_ecoff_flavour: return target_big_endian ? "ecoff-bigmips" : ECOFF_LITTLE_FORMAT; case bfd_target_coff_flavour: @@ -1127,6 +1244,174 @@ mips_target_format (void) } } +/* Return the length of instruction INSN. */ + +static inline unsigned int +insn_length (const struct mips_cl_insn *insn) +{ + if (!mips_opts.mips16) + return 4; + return insn->mips16_absolute_jump_p || insn->use_extend ? 4 : 2; +} + +/* Initialise INSN from opcode entry MO. Leave its position unspecified. */ + +static void +create_insn (struct mips_cl_insn *insn, const struct mips_opcode *mo) +{ + size_t i; + + insn->insn_mo = mo; + insn->use_extend = FALSE; + insn->extend = 0; + insn->insn_opcode = mo->match; + insn->frag = NULL; + insn->where = 0; + for (i = 0; i < ARRAY_SIZE (insn->fixp); i++) + insn->fixp[i] = NULL; + insn->fixed_p = (mips_opts.noreorder > 0); + insn->noreorder_p = (mips_opts.noreorder > 0); + insn->mips16_absolute_jump_p = 0; +} + +/* Install INSN at the location specified by its "frag" and "where" fields. */ + +static void +install_insn (const struct mips_cl_insn *insn) +{ + char *f = insn->frag->fr_literal + insn->where; + if (!mips_opts.mips16) + md_number_to_chars (f, insn->insn_opcode, 4); + else if (insn->mips16_absolute_jump_p) + { + md_number_to_chars (f, insn->insn_opcode >> 16, 2); + md_number_to_chars (f + 2, insn->insn_opcode & 0xffff, 2); + } + else + { + if (insn->use_extend) + { + md_number_to_chars (f, 0xf000 | insn->extend, 2); + f += 2; + } + md_number_to_chars (f, insn->insn_opcode, 2); + } +} + +/* Move INSN to offset WHERE in FRAG. Adjust the fixups accordingly + and install the opcode in the new location. */ + +static void +move_insn (struct mips_cl_insn *insn, fragS *frag, long where) +{ + size_t i; + + insn->frag = frag; + insn->where = where; + for (i = 0; i < ARRAY_SIZE (insn->fixp); i++) + if (insn->fixp[i] != NULL) + { + insn->fixp[i]->fx_frag = frag; + insn->fixp[i]->fx_where = where; + } + install_insn (insn); +} + +/* Add INSN to the end of the output. */ + +static void +add_fixed_insn (struct mips_cl_insn *insn) +{ + char *f = frag_more (insn_length (insn)); + move_insn (insn, frag_now, f - frag_now->fr_literal); +} + +/* Start a variant frag and move INSN to the start of the variant part, + marking it as fixed. The other arguments are as for frag_var. */ + +static void +add_relaxed_insn (struct mips_cl_insn *insn, int max_chars, int var, + relax_substateT subtype, symbolS *symbol, offsetT offset) +{ + frag_grow (max_chars); + move_insn (insn, frag_now, frag_more (0) - frag_now->fr_literal); + insn->fixed_p = 1; + frag_var (rs_machine_dependent, max_chars, var, + subtype, symbol, offset, NULL); +} + +/* Insert N copies of INSN into the history buffer, starting at + position FIRST. Neither FIRST nor N need to be clipped. */ + +static void +insert_into_history (unsigned int first, unsigned int n, + const struct mips_cl_insn *insn) +{ + if (mips_relax.sequence != 2) + { + unsigned int i; + + for (i = ARRAY_SIZE (history); i-- > first;) + if (i >= first + n) + history[i] = history[i - n]; + else + history[i] = *insn; + } +} + +/* Emit a nop instruction, recording it in the history buffer. */ + +static void +emit_nop (void) +{ + add_fixed_insn (NOP_INSN); + insert_into_history (0, 1, NOP_INSN); +} + +/* Initialize vr4120_conflicts. There is a bit of duplication here: + the idea is to make it obvious at a glance that each errata is + included. */ + +static void +init_vr4120_conflicts (void) +{ +#define CONFLICT(FIRST, SECOND) \ + vr4120_conflicts[FIX_VR4120_##FIRST] |= 1 << FIX_VR4120_##SECOND + + /* Errata 21 - [D]DIV[U] after [D]MACC */ + CONFLICT (MACC, DIV); + CONFLICT (DMACC, DIV); + + /* Errata 23 - Continuous DMULT[U]/DMACC instructions. */ + CONFLICT (DMULT, DMULT); + CONFLICT (DMULT, DMACC); + CONFLICT (DMACC, DMULT); + CONFLICT (DMACC, DMACC); + + /* Errata 24 - MT{LO,HI} after [D]MACC */ + CONFLICT (MACC, MTHILO); + CONFLICT (DMACC, MTHILO); + + /* VR4181A errata MD(1): "If a MULT, MULTU, DMULT or DMULTU + instruction is executed immediately after a MACC or DMACC + instruction, the result of [either instruction] is incorrect." */ + CONFLICT (MACC, MULT); + CONFLICT (MACC, DMULT); + CONFLICT (DMACC, MULT); + CONFLICT (DMACC, DMULT); + + /* VR4181A errata MD(4): "If a MACC or DMACC instruction is + executed immediately after a DMULT, DMULTU, DIV, DIVU, + DDIV or DDIVU instruction, the result of the MACC or + DMACC instruction is incorrect.". */ + CONFLICT (DMULT, MACC); + CONFLICT (DMULT, DMACC); + CONFLICT (DIV, MACC); + CONFLICT (DIV, DMACC); + +#undef CONFLICT +} + /* This function is called once, at assembler startup time. It should set up all the tables, etc. that the MD part of the assembler will need. */ @@ -1137,6 +1422,13 @@ md_begin (void) int i = 0; int broken = 0; + if (mips_pic != NO_PIC) + { + if (g_switch_seen && g_switch_value != 0) + as_bad (_("-G may not be used in position-independent code")); + g_switch_value = 0; + } + if (! bfd_set_arch_mach (stdoutput, bfd_arch_mips, file_mips_arch)) as_warn (_("Could not set architecture and machine")); @@ -1160,6 +1452,11 @@ md_begin (void) { if (!validate_mips_insn (&mips_opcodes[i])) broken = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Jun 11 14:05:35 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B40C1065672; Fri, 11 Jun 2010 14:05:35 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51EAA8FC1A; Fri, 11 Jun 2010 14:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BE5Zrm095806; Fri, 11 Jun 2010 14:05:35 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BE5Zpe095805; Fri, 11 Jun 2010 14:05:35 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006111405.o5BE5Zpe095805@svn.freebsd.org> From: Roman Divacky Date: Fri, 11 Jun 2010 14:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209041 - in projects/clangbsd/contrib/llvm: Xcode cmake docs projects test tools/clang/INPUTS tools/clang/clang.xcodeproj tools/clang/docs tools/clang/test tools/clang/win32 tools/clan... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 14:05:35 -0000 Author: rdivacky Date: Fri Jun 11 14:05:34 2010 New Revision: 209041 URL: http://svn.freebsd.org/changeset/base/209041 Log: Delete unused stuff. Deleted: projects/clangbsd/contrib/llvm/Xcode/ projects/clangbsd/contrib/llvm/cmake/ projects/clangbsd/contrib/llvm/docs/ projects/clangbsd/contrib/llvm/projects/ projects/clangbsd/contrib/llvm/test/ projects/clangbsd/contrib/llvm/tools/clang/INPUTS/ projects/clangbsd/contrib/llvm/tools/clang/clang.xcodeproj/ projects/clangbsd/contrib/llvm/tools/clang/docs/ projects/clangbsd/contrib/llvm/tools/clang/test/ projects/clangbsd/contrib/llvm/tools/clang/win32/ projects/clangbsd/contrib/llvm/tools/clang/www/ projects/clangbsd/contrib/llvm/unittests/ projects/clangbsd/contrib/llvm/website/ projects/clangbsd/contrib/llvm/win32/ From owner-svn-src-projects@FreeBSD.ORG Fri Jun 11 14:09:49 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4611065670; Fri, 11 Jun 2010 14:09:49 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FFCF8FC14; Fri, 11 Jun 2010 14:09:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BE9njR096848; Fri, 11 Jun 2010 14:09:49 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BE9nVo096847; Fri, 11 Jun 2010 14:09:49 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006111409.o5BE9nVo096847@svn.freebsd.org> From: Roman Divacky Date: Fri, 11 Jun 2010 14:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209043 - in projects/clangbsd/contrib/llvm: examples tools/clang/examples X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 14:09:49 -0000 Author: rdivacky Date: Fri Jun 11 14:09:49 2010 New Revision: 209043 URL: http://svn.freebsd.org/changeset/base/209043 Log: Remove examples too. Deleted: projects/clangbsd/contrib/llvm/examples/ projects/clangbsd/contrib/llvm/tools/clang/examples/ From owner-svn-src-projects@FreeBSD.ORG Fri Jun 11 14:11:25 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC5B4106566C; Fri, 11 Jun 2010 14:11:25 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331908FC1E; Fri, 11 Jun 2010 14:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BEBPc9097311; Fri, 11 Jun 2010 14:11:25 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BEBPwM097308; Fri, 11 Jun 2010 14:11:25 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006111411.o5BEBPwM097308@svn.freebsd.org> From: Roman Divacky Date: Fri, 11 Jun 2010 14:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209045 - in projects/clangbsd/usr.bin/clang: clang tblgen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 14:11:25 -0000 Author: rdivacky Date: Fri Jun 11 14:11:24 2010 New Revision: 209045 URL: http://svn.freebsd.org/changeset/base/209045 Log: Reshuffle to be in sync with head. Modified: projects/clangbsd/usr.bin/clang/clang/Makefile projects/clangbsd/usr.bin/clang/tblgen/Makefile Modified: projects/clangbsd/usr.bin/clang/clang/Makefile ============================================================================== --- projects/clangbsd/usr.bin/clang/clang/Makefile Fri Jun 11 14:10:20 2010 (r209044) +++ projects/clangbsd/usr.bin/clang/clang/Makefile Fri Jun 11 14:11:24 2010 (r209045) @@ -10,9 +10,9 @@ MAN= LINKS= ${BINDIR}/clang ${BINDIR}/clang++ -TGHDRS= DiagnosticCommonKinds DiagnosticDriverKinds \ - DiagnosticFrontendKinds DiagnosticLexKinds DiagnosticSemaKinds \ - CC1Options CC1AsOptions Options +TGHDRS= CC1AsOptions CC1Options DiagnosticCommonKinds \ + DiagnosticDriverKinds DiagnosticFrontendKinds \ + DiagnosticLexKinds DiagnosticSemaKinds Options LIBDEPS=clangfrontend clangdriver clangcodegen clangsema clangchecker \ clanganalysis clangrewrite clangast clangparse clanglex clangbasic \ \ Modified: projects/clangbsd/usr.bin/clang/tblgen/Makefile ============================================================================== --- projects/clangbsd/usr.bin/clang/tblgen/Makefile Fri Jun 11 14:10:20 2010 (r209044) +++ projects/clangbsd/usr.bin/clang/tblgen/Makefile Fri Jun 11 14:11:24 2010 (r209045) @@ -6,16 +6,16 @@ SRCDIR= utils/TableGen SRCS= ARMDecoderEmitter.cpp AsmMatcherEmitter.cpp \ AsmWriterEmitter.cpp AsmWriterInst.cpp CallingConvEmitter.cpp \ ClangASTNodesEmitter.cpp ClangDiagnosticsEmitter.cpp \ - CodeEmitterGen.cpp CodeGenDAGPatterns.cpp CodeGenInstruction.cpp \ - CodeGenTarget.cpp DAGISelEmitter.cpp DAGISelMatcher.cpp \ - DAGISelMatcherEmitter.cpp DAGISelMatcherGen.cpp \ - DAGISelMatcherOpt.cpp DisassemblerEmitter.cpp EDEmitter.cpp \ - FastISelEmitter.cpp InstrEnumEmitter.cpp InstrInfoEmitter.cpp \ - IntrinsicEmitter.cpp LLVMCConfigurationEmitter.cpp \ - OptParserEmitter.cpp Record.cpp RegisterInfoEmitter.cpp \ - SubtargetEmitter.cpp TGLexer.cpp TGParser.cpp TGValueTypes.cpp \ - TableGen.cpp TableGenBackend.cpp X86DisassemblerTables.cpp \ - X86RecognizableInstr.cpp + CodeEmitterGen.cpp CodeGenDAGPatterns.cpp \ + CodeGenInstruction.cpp CodeGenTarget.cpp DAGISelEmitter.cpp \ + DAGISelMatcher.cpp DAGISelMatcherEmitter.cpp \ + DAGISelMatcherGen.cpp DAGISelMatcherOpt.cpp \ + DisassemblerEmitter.cpp EDEmitter.cpp FastISelEmitter.cpp \ + InstrEnumEmitter.cpp InstrInfoEmitter.cpp IntrinsicEmitter.cpp \ + LLVMCConfigurationEmitter.cpp OptParserEmitter.cpp Record.cpp \ + RegisterInfoEmitter.cpp SubtargetEmitter.cpp TGLexer.cpp \ + TGParser.cpp TGValueTypes.cpp TableGen.cpp TableGenBackend.cpp \ + X86DisassemblerTables.cpp X86RecognizableInstr.cpp MAN= REQUIRES_EH= From owner-svn-src-projects@FreeBSD.ORG Sat Jun 12 04:41:14 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741F11065678; Sat, 12 Jun 2010 04:41:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600FF8FC0A; Sat, 12 Jun 2010 04:41:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C4fEbq091492; Sat, 12 Jun 2010 04:41:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C4fEOt091480; Sat, 12 Jun 2010 04:41:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006120441.o5C4fEOt091480@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Jun 2010 04:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209087 - in projects/altix/sys: amd64/acpica amd64/amd64 amd64/linux32 arm/arm cam cam/scsi cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/cyclic cddl/dev/dtrace cddl/dev/dtrace/a... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 04:41:14 -0000 Author: marcel Date: Sat Jun 12 04:41:13 2010 New Revision: 209087 URL: http://svn.freebsd.org/changeset/base/209087 Log: Merge svn+ssh://svn.freebsd.org/base/head@209086 Added: projects/altix/sys/modules/netgraph/patch/ - copied from r209086, head/sys/modules/netgraph/patch/ projects/altix/sys/netgraph/ng_patch.c - copied unchanged from r209086, head/sys/netgraph/ng_patch.c projects/altix/sys/netgraph/ng_patch.h - copied unchanged from r209086, head/sys/netgraph/ng_patch.h projects/altix/sys/x86/x86/io_apic.c - copied unchanged from r209086, head/sys/x86/x86/io_apic.c projects/altix/sys/x86/x86/mca.c - copied unchanged from r209086, head/sys/x86/x86/mca.c projects/altix/sys/x86/x86/msi.c - copied unchanged from r209086, head/sys/x86/x86/msi.c Deleted: projects/altix/sys/amd64/amd64/io_apic.c projects/altix/sys/amd64/amd64/mca.c projects/altix/sys/amd64/amd64/msi.c projects/altix/sys/i386/i386/io_apic.c projects/altix/sys/i386/i386/mca.c projects/altix/sys/i386/i386/msi.c Modified: projects/altix/sys/amd64/acpica/madt.c projects/altix/sys/amd64/amd64/legacy.c projects/altix/sys/amd64/amd64/pmap.c projects/altix/sys/amd64/linux32/linux32_machdep.c projects/altix/sys/arm/arm/pmap.c projects/altix/sys/cam/cam_debug.h projects/altix/sys/cam/cam_xpt.c projects/altix/sys/cam/cam_xpt_internal.h projects/altix/sys/cam/scsi/scsi_all.c projects/altix/sys/cam/scsi/scsi_all.h projects/altix/sys/cam/scsi/scsi_ch.h projects/altix/sys/cam/scsi/scsi_da.c projects/altix/sys/cam/scsi/scsi_xpt.c projects/altix/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c projects/altix/sys/cddl/dev/cyclic/cyclic.c projects/altix/sys/cddl/dev/dtrace/amd64/dtrace_subr.c projects/altix/sys/cddl/dev/dtrace/dtrace_debug.c projects/altix/sys/cddl/dev/dtrace/dtrace_load.c projects/altix/sys/cddl/dev/dtrace/i386/dtrace_subr.c projects/altix/sys/compat/linprocfs/linprocfs.c projects/altix/sys/conf/NOTES projects/altix/sys/conf/files projects/altix/sys/conf/files.amd64 projects/altix/sys/conf/files.i386 projects/altix/sys/conf/files.pc98 projects/altix/sys/conf/options projects/altix/sys/dev/acpi_support/acpi_asus.c projects/altix/sys/dev/acpi_support/acpi_fujitsu.c projects/altix/sys/dev/acpi_support/acpi_hp.c projects/altix/sys/dev/acpi_support/acpi_ibm.c projects/altix/sys/dev/acpica/acpi.c projects/altix/sys/dev/acpica/acpi_cpu.c projects/altix/sys/dev/acpica/acpi_dock.c projects/altix/sys/dev/acpica/acpi_thermal.c projects/altix/sys/dev/acpica/acpi_video.c projects/altix/sys/dev/ahci/ahci.c projects/altix/sys/dev/bge/if_bgereg.h projects/altix/sys/dev/cxgb/cxgb_main.c projects/altix/sys/dev/e1000/if_igb.c projects/altix/sys/dev/isp/isp_freebsd.c projects/altix/sys/dev/isp/isp_library.c projects/altix/sys/dev/ixgbe/ixgbe.c projects/altix/sys/dev/sound/pci/hda/hdac.c projects/altix/sys/dev/twa/tw_cl.h projects/altix/sys/dev/twa/tw_cl_fwif.h projects/altix/sys/dev/twa/tw_cl_init.c projects/altix/sys/dev/twa/tw_cl_intr.c projects/altix/sys/dev/twa/tw_cl_io.c projects/altix/sys/dev/twa/tw_cl_misc.c projects/altix/sys/dev/twa/tw_cl_share.h projects/altix/sys/dev/twa/tw_osl.h projects/altix/sys/dev/twa/tw_osl_cam.c projects/altix/sys/dev/twa/tw_osl_externs.h projects/altix/sys/dev/twa/tw_osl_freebsd.c projects/altix/sys/dev/twa/tw_osl_inline.h projects/altix/sys/dev/twa/tw_osl_share.h projects/altix/sys/dev/usb/usb_dev.c projects/altix/sys/dev/usb/usb_device.c projects/altix/sys/dev/usb/usb_process.c projects/altix/sys/dev/xen/netfront/netfront.c projects/altix/sys/fs/devfs/devfs.h projects/altix/sys/fs/devfs/devfs_devs.c projects/altix/sys/fs/devfs/devfs_vnops.c projects/altix/sys/fs/procfs/procfs_type.c projects/altix/sys/geom/geom_dev.c projects/altix/sys/geom/geom_event.c projects/altix/sys/geom/geom_io.c projects/altix/sys/i386/acpica/madt.c projects/altix/sys/i386/i386/legacy.c projects/altix/sys/i386/i386/mp_machdep.c projects/altix/sys/i386/i386/pmap.c projects/altix/sys/i386/linux/linux_machdep.c projects/altix/sys/i386/xen/pmap.c projects/altix/sys/ia64/ia64/busdma_machdep.c projects/altix/sys/ia64/ia64/exception.S projects/altix/sys/ia64/ia64/pmap.c projects/altix/sys/ia64/ia64/vm_machdep.c projects/altix/sys/ia64/include/md_var.h projects/altix/sys/kern/kern_clock.c projects/altix/sys/kern/kern_intr.c projects/altix/sys/kern/kern_switch.c projects/altix/sys/kern/kern_sx.c projects/altix/sys/kern/kern_timeout.c projects/altix/sys/kern/sched_4bsd.c projects/altix/sys/kern/sched_ule.c projects/altix/sys/kern/subr_bus.c projects/altix/sys/kern/subr_kdb.c projects/altix/sys/kern/subr_lock.c projects/altix/sys/kern/subr_pcpu.c projects/altix/sys/kern/subr_smp.c projects/altix/sys/kern/subr_taskqueue.c projects/altix/sys/kern/sysv_sem.c projects/altix/sys/kern/sysv_shm.c projects/altix/sys/kern/vfs_bio.c projects/altix/sys/mips/mips/pmap.c projects/altix/sys/modules/netgraph/Makefile projects/altix/sys/net/flowtable.c projects/altix/sys/net/if_epair.c projects/altix/sys/net/netisr.c projects/altix/sys/net80211/ieee80211_hwmp.c projects/altix/sys/net80211/ieee80211_sta.c projects/altix/sys/netinet/sctp_indata.c projects/altix/sys/netinet/sctp_pcb.c projects/altix/sys/netinet/sctp_usrreq.c projects/altix/sys/netinet/sctputil.c projects/altix/sys/powerpc/aim/mmu_oea.c projects/altix/sys/powerpc/aim/mmu_oea64.c projects/altix/sys/powerpc/booke/pmap.c projects/altix/sys/sparc64/sparc64/pmap.c projects/altix/sys/sun4v/sun4v/pmap.c projects/altix/sys/sys/buf.h projects/altix/sys/sys/file.h projects/altix/sys/sys/nlist_aout.h projects/altix/sys/sys/param.h projects/altix/sys/sys/proc.h projects/altix/sys/sys/smp.h projects/altix/sys/sys/vnode.h projects/altix/sys/ufs/ffs/ffs_softdep.c projects/altix/sys/vm/uma_core.c projects/altix/sys/vm/vm_page.c projects/altix/sys/vm/vm_page.h projects/altix/sys/vm/vm_pageout.c Directory Properties: projects/altix/lib/libstand/ (props changed) projects/altix/sys/ (props changed) projects/altix/sys/amd64/include/xen/ (props changed) projects/altix/sys/cddl/contrib/opensolaris/ (props changed) projects/altix/sys/contrib/dev/acpica/ (props changed) projects/altix/sys/contrib/x86emu/ (props changed) projects/altix/sys/dev/xen/xenpci/ (props changed) Modified: projects/altix/sys/amd64/acpica/madt.c ============================================================================== --- projects/altix/sys/amd64/acpica/madt.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/amd64/acpica/madt.c Sat Jun 12 04:41:13 2010 (r209087) @@ -557,9 +557,7 @@ madt_set_ids(void *dummy) if (madt == NULL) return; - for (i = 0; i < MAXCPU; i++) { - if (CPU_ABSENT(i)) - continue; + CPU_FOREACH(i) { pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); la = &lapics[pc->pc_apic_id]; Modified: projects/altix/sys/amd64/amd64/legacy.c ============================================================================== --- projects/altix/sys/amd64/amd64/legacy.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/amd64/amd64/legacy.c Sat Jun 12 04:41:13 2010 (r209087) @@ -269,12 +269,11 @@ cpu_identify(driver_t *driver, device_t * so that these devices are attached after the Host-PCI * bridges (which are added at order 100). */ - for (i = 0; i <= mp_maxid; i++) - if (!CPU_ABSENT(i)) { - child = BUS_ADD_CHILD(parent, 150, "cpu", i); - if (child == NULL) - panic("legacy_attach cpu"); - } + CPU_FOREACH(i) { + child = BUS_ADD_CHILD(parent, 150, "cpu", i); + if (child == NULL) + panic("legacy_attach cpu"); + } } static device_t Modified: projects/altix/sys/amd64/amd64/pmap.c ============================================================================== --- projects/altix/sys/amd64/amd64/pmap.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/amd64/amd64/pmap.c Sat Jun 12 04:41:13 2010 (r209087) @@ -3138,7 +3138,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va)); - KASSERT((m->oflags & VPO_BUSY) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; @@ -3899,30 +3900,35 @@ pmap_page_exists_quick(pmap_t pmap, vm_p struct md_page *pvh; pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - if (loops < 16) { + if (!rv && loops < 16) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { - if (PV_PMAP(pv) == pmap) - return (TRUE); + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } loops++; if (loops >= 16) break; } } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4335,10 +4341,10 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - if (m->flags & PG_FICTITIOUS) - return (rtval); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + vm_page_lock_queues(); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4362,7 +4368,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4391,6 +4397,8 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: + vm_page_unlock_queues(); return (rtval); } Modified: projects/altix/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- projects/altix/sys/amd64/linux32/linux32_machdep.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/amd64/linux32/linux32_machdep.c Sat Jun 12 04:41:13 2010 (r209087) @@ -835,9 +835,13 @@ linux_mmap_common(struct thread *td, l_u bsd_args.flags |= MAP_PRIVATE; if (flags & LINUX_MAP_FIXED) bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) + if (flags & LINUX_MAP_ANON) { + /* Enforce pos to be on page boundary, then ignore. */ + if ((pos & PAGE_MASK) != 0) + return (EINVAL); + pos = 0; bsd_args.flags |= MAP_ANON; - else + } else bsd_args.flags |= MAP_NOSYNC; if (flags & LINUX_MAP_GROWSDOWN) bsd_args.flags |= MAP_STACK; Modified: projects/altix/sys/arm/arm/pmap.c ============================================================================== --- projects/altix/sys/arm/arm/pmap.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/arm/arm/pmap.c Sat Jun 12 04:41:13 2010 (r209087) @@ -1423,7 +1423,7 @@ pmap_clearbit(struct vm_page *pg, u_int u_int oflags; int count = 0; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; @@ -1433,6 +1433,7 @@ pmap_clearbit(struct vm_page *pg, u_int pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { + vm_page_unlock_queues(); return (0); } @@ -1568,6 +1569,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) vm_page_flag_clear(pg, PG_WRITEABLE); + vm_page_unlock_queues(); return (count); } @@ -3324,7 +3326,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || + (m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); } @@ -4417,24 +4420,23 @@ pmap_page_exists_quick(pmap_t pmap, vm_p { pv_entry_t pv; int loops = 0; + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - - /* - * Not found, check current mappings returning immediately - */ - for (pv = TAILQ_FIRST(&m->md.pv_list); - pv; - pv = TAILQ_NEXT(pv, pv_list)) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_page_exists_quick: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { - return (TRUE); + rv = TRUE; + break; } loops++; if (loops >= 16) break; } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } /* @@ -4469,8 +4471,8 @@ int pmap_ts_referenced(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return (0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_ts_referenced: page %p is not managed", m)); return (pmap_clearbit(m, PVF_REF)); } @@ -4508,10 +4510,8 @@ pmap_clear_modify(vm_page_t m) */ if ((m->flags & PG_WRITEABLE) == 0) return; - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); - vm_page_unlock_queues(); } @@ -4541,10 +4541,8 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_REF) pmap_clearbit(m, PVF_REF); - vm_page_unlock_queues(); } @@ -4565,11 +4563,8 @@ pmap_remove_write(vm_page_t m) */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) != 0 || - (m->flags & PG_WRITEABLE) != 0) { - vm_page_lock_queues(); + (m->flags & PG_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); - vm_page_unlock_queues(); - } } Modified: projects/altix/sys/cam/cam_debug.h ============================================================================== --- projects/altix/sys/cam/cam_debug.h Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/cam/cam_debug.h Sat Jun 12 04:41:13 2010 (r209087) @@ -40,7 +40,8 @@ typedef enum { CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */ CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */ CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */ - CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */ + CAM_DEBUG_PERIPH = 0x20, /* print out peripheral calls */ + CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; #if defined(CAMDEBUG) && defined(_KERNEL) @@ -58,6 +59,7 @@ extern u_int32_t cam_debug_delay; && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) + #define CAM_DEBUG(path, flag, printfargs) \ if ((cam_dflags & (flag)) \ && (cam_dpath != NULL) \ @@ -68,6 +70,7 @@ extern u_int32_t cam_debug_delay; if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } + #define CAM_DEBUG_PRINT(flag, printfargs) \ if (cam_dflags & (flag)) { \ printf("cam_debug: "); \ @@ -76,11 +79,20 @@ extern u_int32_t cam_debug_delay; DELAY(cam_debug_delay); \ } +#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ + if (cam_dflags & (flag)) { \ + xpt_print(path, "cam_debug: "); \ + printf printfargs; \ + if (cam_debug_delay != 0) \ + DELAY(cam_debug_delay); \ + } + #else /* !CAMDEBUG || !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) +#define CAM_DEBUG_PATH_PRINT(A, B, C) #endif /* CAMDEBUG && _KERNEL */ Modified: projects/altix/sys/cam/cam_xpt.c ============================================================================== --- projects/altix/sys/cam/cam_xpt.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/cam/cam_xpt.c Sat Jun 12 04:41:13 2010 (r209087) @@ -196,8 +196,18 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ #ifdef CAMDEBUG struct cam_path *cam_dpath; -u_int32_t cam_dflags; +#ifdef CAM_DEBUG_FLAGS +u_int32_t cam_dflags = CAM_DEBUG_FLAGS; +#else +u_int32_t cam_dflags = CAM_DEBUG_NONE; +#endif +TUNABLE_INT("kern.cam.dflags", &cam_dflags); +SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, + &cam_dflags, 0, "Cam Debug Flags"); u_int32_t cam_debug_delay; +TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); +SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, + &cam_debug_delay, 0, "Cam Debug Flags"); #endif /* Our boot-time initialization hook */ @@ -4212,6 +4222,7 @@ xpt_alloc_target(struct cam_eb *bus, tar target->target_id = target_id; target->refcount = 1; target->generation = 0; + target->luns = NULL; timevalclear(&target->last_reset); /* * Hold a reference to our parent bus so it @@ -4243,6 +4254,8 @@ xpt_release_target(struct cam_et *target TAILQ_REMOVE(&target->bus->et_entries, target, links); target->bus->generation++; xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); free(target, M_CAMXPT); } } @@ -4505,11 +4518,6 @@ xpt_config(void *arg) #ifdef CAMDEBUG /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_FLAGS - cam_dflags = CAM_DEBUG_FLAGS; -#else /* !CAM_DEBUG_FLAGS */ - cam_dflags = CAM_DEBUG_NONE; -#endif /* CAM_DEBUG_FLAGS */ #ifdef CAM_DEBUG_BUS if (cam_dflags != CAM_DEBUG_NONE) { /* Modified: projects/altix/sys/cam/cam_xpt_internal.h ============================================================================== --- projects/altix/sys/cam/cam_xpt_internal.h Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/cam/cam_xpt_internal.h Sat Jun 12 04:41:13 2010 (r209087) @@ -135,6 +135,8 @@ struct cam_et { u_int32_t refcount; u_int generation; struct timeval last_reset; + u_int rpl_size; + struct scsi_report_luns_data *luns; }; /* Modified: projects/altix/sys/cam/scsi/scsi_all.c ============================================================================== --- projects/altix/sys/cam/scsi/scsi_all.c Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/cam/scsi/scsi_all.c Sat Jun 12 04:41:13 2010 (r209087) @@ -3954,6 +3954,57 @@ scsi_report_luns(struct ccb_scsiio *csio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TARGET_PORT_GROUPS | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void +scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TARGET_PORT_GROUPS; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: projects/altix/sys/cam/scsi/scsi_all.h ============================================================================== --- projects/altix/sys/cam/scsi/scsi_all.h Sat Jun 12 02:00:15 2010 (r209086) +++ projects/altix/sys/cam/scsi/scsi_all.h Sat Jun 12 04:41:13 2010 (r209087) @@ -22,7 +22,7 @@ */ #ifndef _SCSI_SCSI_ALL_H -#define _SCSI_SCSI_ALL_H 1 +#define _SCSI_SCSI_ALL_H 1 #include @@ -41,13 +41,13 @@ extern int scsi_delay; /* * Define dome bits that are in ALL (or a lot of) scsi commands */ -#define SCSI_CTL_LINK 0x01 -#define SCSI_CTL_FLAG 0x02 -#define SCSI_CTL_VENDOR 0xC0 +#define SCSI_CTL_LINK 0x01 +#define SCSI_CTL_FLAG 0x02 +#define SCSI_CTL_VENDOR 0xC0 #define SCSI_CMD_LUN 0xA0 /* these two should not be needed */ #define SCSI_CMD_LUN_SHIFT 5 /* LUN in the cmd is no longer SCSI */ -#define SCSI_MAX_CDBLEN 16 /* +#define SCSI_MAX_CDBLEN 16 /* * 16 byte commands are in the * SCSI-3 spec */ @@ -56,7 +56,7 @@ extern int scsi_delay; #endif /* 6byte CDBs special case 0 length to be 256 */ -#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) +#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) /* * This type defines actions to be taken when a particular sense code is @@ -94,16 +94,16 @@ typedef enum { } scsi_sense_action_qualifier; /* Mask for error status values */ -#define SS_ERRMASK 0xff +#define SS_ERRMASK 0xff /* The default, retyable, error action */ -#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO +#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO /* The retyable, error action, with table specified error code */ -#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE +#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE /* Fatal error action, with table specified error code */ -#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE +#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE struct scsi_generic { @@ -168,16 +168,16 @@ struct scsi_mode_sense_6 #define SMS_DBD 0x08 u_int8_t page; #define SMS_PAGE_CODE 0x3F -#define SMS_VENDOR_SPECIFIC_PAGE 0x00 -#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 -#define SMS_FORMAT_DEVICE_PAGE 0x03 -#define SMS_GEOMETRY_PAGE 0x04 -#define SMS_CACHE_PAGE 0x08 -#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 -#define SMS_CONTROL_MODE_PAGE 0x0A -#define SMS_PROTO_SPECIFIC_PAGE 0x19 -#define SMS_INFO_EXCEPTIONS_PAGE 0x1C -#define SMS_ALL_PAGES_PAGE 0x3F +#define SMS_VENDOR_SPECIFIC_PAGE 0x00 +#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 +#define SMS_FORMAT_DEVICE_PAGE 0x03 +#define SMS_GEOMETRY_PAGE 0x04 +#define SMS_CACHE_PAGE 0x08 +#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 +#define SMS_CONTROL_MODE_PAGE 0x0A +#define SMS_PROTO_SPECIFIC_PAGE 0x19 +#define SMS_INFO_EXCEPTIONS_PAGE 0x1C +#define SMS_ALL_PAGES_PAGE 0x3F #define SMS_PAGE_CTRL_MASK 0xC0 #define SMS_PAGE_CTRL_CURRENT 0x00 #define SMS_PAGE_CTRL_CHANGEABLE 0x40 @@ -262,8 +262,8 @@ struct scsi_log_sense #define SLS_ERROR_VERIFY_PAGE 0x05 #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 -#define SLS_SELF_TEST_PAGE 0x10 -#define SLS_IE_PAGE 0x2f +#define SLS_SELF_TEST_PAGE 0x10 +#define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 #define SLS_PAGE_CTRL_THRESHOLD 0x00 #define SLS_PAGE_CTRL_CUMULATIVE 0x40 @@ -320,30 +320,30 @@ struct scsi_control_page { u_int8_t page_code; u_int8_t page_length; u_int8_t rlec; -#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ +#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ u_int8_t queue_flags; -#define SCP_QUEUE_ALG_MASK 0xF0 -#define SCP_QUEUE_ALG_RESTRICTED 0x00 -#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 -#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ -#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ +#define SCP_QUEUE_ALG_MASK 0xF0 +#define SCP_QUEUE_ALG_RESTRICTED 0x00 +#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 +#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ +#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ u_int8_t eca_and_aen; -#define SCP_EECA 0x80 /*Enable Extended CA*/ -#define SCP_RAENP 0x04 /*Ready AEN Permission*/ -#define SCP_UAAENP 0x02 /*UA AEN Permission*/ -#define SCP_EAENP 0x01 /*Error AEN Permission*/ +#define SCP_EECA 0x80 /*Enable Extended CA*/ +#define SCP_RAENP 0x04 /*Ready AEN Permission*/ +#define SCP_UAAENP 0x02 /*UA AEN Permission*/ +#define SCP_EAENP 0x01 /*Error AEN Permission*/ u_int8_t reserved; u_int8_t aen_holdoff_period[2]; }; struct scsi_cache_page { u_int8_t page_code; -#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t cache_flags; -#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ -#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ -#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ +#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ +#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ +#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ u_int8_t rw_cache_policy; u_int8_t dis_prefetch[2]; u_int8_t min_prefetch[2]; @@ -353,16 +353,16 @@ struct scsi_cache_page { struct scsi_info_exceptions_page { u_int8_t page_code; -#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t info_flags; -#define SIEP_FLAGS_PERF 0x80 -#define SIEP_FLAGS_EBF 0x20 -#define SIEP_FLAGS_EWASC 0x10 -#define SIEP_FLAGS_DEXCPT 0x08 -#define SIEP_FLAGS_TEST 0x04 -#define SIEP_FLAGS_EBACKERR 0x02 -#define SIEP_FLAGS_LOGERR 0x01 +#define SIEP_FLAGS_PERF 0x80 +#define SIEP_FLAGS_EBF 0x20 +#define SIEP_FLAGS_EWASC 0x10 +#define SIEP_FLAGS_DEXCPT 0x08 +#define SIEP_FLAGS_TEST 0x04 +#define SIEP_FLAGS_EBACKERR 0x02 +#define SIEP_FLAGS_LOGERR 0x01 u_int8_t mrie; u_int8_t interval_timer[4]; u_int8_t report_count[4]; @@ -370,19 +370,19 @@ struct scsi_info_exceptions_page { struct scsi_proto_specific_page { u_int8_t page_code; -#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t protocol; -#define SPSP_PROTO_FC 0x00 -#define SPSP_PROTO_SPI 0x01 -#define SPSP_PROTO_SSA 0x02 -#define SPSP_PROTO_1394 0x03 -#define SPSP_PROTO_RDMA 0x04 -#define SPSP_PROTO_ISCSI 0x05 -#define SPSP_PROTO_SAS 0x06 -#define SPSP_PROTO_ADT 0x07 -#define SPSP_PROTO_ATA 0x08 -#define SPSP_PROTO_NONE 0x0f +#define SPSP_PROTO_FC 0x00 +#define SPSP_PROTO_SPI 0x01 +#define SPSP_PROTO_SSA 0x02 +#define SPSP_PROTO_1394 0x03 +#define SPSP_PROTO_RDMA 0x04 +#define SPSP_PROTO_ISCSI 0x05 +#define SPSP_PROTO_SAS 0x06 +#define SPSP_PROTO_ADT 0x07 +#define SPSP_PROTO_ATA 0x08 +#define SPSP_PROTO_NONE 0x0f }; struct scsi_reserve @@ -412,7 +412,7 @@ struct scsi_prevent u_int8_t control; }; #define PR_PREVENT 0x01 -#define PR_ALLOW 0x00 +#define PR_ALLOW 0x00 struct scsi_sync_cache { @@ -490,7 +490,7 @@ struct scsi_rw_12 { u_int8_t opcode; #define SRW12_RELADDR 0x01 -#define SRW12_FUA 0x08 +#define SRW12_FUA 0x08 #define SRW12_DPO 0x10 u_int8_t byte2; u_int8_t addr[4]; @@ -527,13 +527,13 @@ struct scsi_start_stop_unit struct ata_pass_12 { u_int8_t opcode; u_int8_t protocol; -#define AP_MULTI 0xe0 +#define AP_MULTI 0xe0 u_int8_t flags; -#define AP_T_LEN 0x03 -#define AP_BB 0x04 -#define AP_T_DIR 0x08 -#define AP_CK_COND 0x20 -#define AP_OFFLINE 0x60 +#define AP_T_LEN 0x03 +#define AP_BB 0x04 +#define AP_T_DIR 0x08 +#define AP_CK_COND 0x20 +#define AP_OFFLINE 0x60 u_int8_t features; u_int8_t sector_count; u_int8_t lba_low; @@ -548,7 +548,7 @@ struct ata_pass_12 { struct ata_pass_16 { u_int8_t opcode; u_int8_t protocol; -#define AP_EXTEND 0x01 +#define AP_EXTEND 0x01 u_int8_t flags; u_int8_t features_ext; u_int8_t features; @@ -565,51 +565,69 @@ struct ata_pass_16 { u_int8_t control; }; -#define SC_SCSI_1 0x01 -#define SC_SCSI_2 0x03 +#define SC_SCSI_1 0x01 +#define SC_SCSI_2 0x03 /* * Opcodes */ #define TEST_UNIT_READY 0x00 -#define REQUEST_SENSE 0x03 +#define REQUEST_SENSE 0x03 #define READ_6 0x08 -#define WRITE_6 0x0a -#define INQUIRY 0x12 -#define MODE_SELECT_6 0x15 -#define MODE_SENSE_6 0x1a -#define START_STOP_UNIT 0x1b -#define START_STOP 0x1b -#define RESERVE 0x16 -#define RELEASE 0x17 -#define RECEIVE_DIAGNOSTIC 0x1c -#define SEND_DIAGNOSTIC 0x1d -#define PREVENT_ALLOW 0x1e +#define WRITE_6 0x0A +#define INQUIRY 0x12 +#define MODE_SELECT_6 0x15 +#define MODE_SENSE_6 0x1A +#define START_STOP_UNIT 0x1B +#define START_STOP 0x1B +#define RESERVE 0x16 +#define RELEASE 0x17 +#define RECEIVE_DIAGNOSTIC 0x1C +#define SEND_DIAGNOSTIC 0x1D +#define PREVENT_ALLOW 0x1E #define READ_CAPACITY 0x25 #define READ_10 0x28 -#define WRITE_10 0x2a -#define POSITION_TO_ELEMENT 0x2b +#define WRITE_10 0x2A +#define POSITION_TO_ELEMENT 0x2B #define SYNCHRONIZE_CACHE 0x35 #define READ_DEFECT_DATA_10 0x37 -#define WRITE_BUFFER 0x3b -#define READ_BUFFER 0x3c +#define WRITE_BUFFER 0x3B +#define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 -#define LOG_SELECT 0x4c -#define LOG_SENSE 0x4d +#define LOG_SELECT 0x4C +#define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 #define MODE_SENSE_10 0x5A #define ATA_PASS_16 0x85 #define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e +#define WRITE_16 0x8A +#define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 -#define ATA_PASS_12 0xa1 -#define MOVE_MEDIUM 0xa5 -#define READ_12 0xa8 -#define WRITE_12 0xaa -#define READ_ELEMENT_STATUS 0xb8 - +#define ATA_PASS_12 0xA1 +#define MAINTENANCE_IN 0xA3 +#define MAINTENANCE_OUT 0xA4 +#define MOVE_MEDIUM 0xA5 +#define READ_12 0xA8 +#define WRITE_12 0xAA +#define READ_ELEMENT_STATUS 0xB8 + +/* Maintenance In Service Action Codes */ +#define REPORT_IDENTIFYING_INFRMATION 0x05 +#define REPORT_TARGET_PORT_GROUPS 0x0A +#define REPORT_ALIASES 0x0B +#define REPORT_SUPPORTED_OPERATION_CODES 0x0C +#define REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0D +#define REPORT_PRIORITY 0x0E +#define REPORT_TIMESTAMP 0x0F +#define MANAGEMENT_PROTOCOL_IN 0x10 +/* Maintenance Out Service Action Codes */ +#define SET_IDENTIFY_INFORMATION 0x06 +#define SET_TARGET_PORT_GROUPS 0x0A +#define CHANGE_ALIASES 0x0B +#define SET_PRIORITY 0x0E +#define SET_TIMESTAMP 0x0F +#define MANGAEMENT_PROTOCOL_OUT 0x10 /* * Device Types @@ -635,7 +653,7 @@ struct ata_pass_16 { #define T_NODEVICE 0x1f #define T_ANY 0xff /* Used in Quirk table matches */ -#define T_REMOV 1 +#define T_REMOV 1 #define T_FIXED 0 /* @@ -670,7 +688,7 @@ struct scsi_inquiry_data * physical device is not currently * connected to this logical unit. */ -#define SID_QUAL_RSVD 0x02 +#define SID_QUAL_RSVD 0x02 #define SID_QUAL_BAD_LU 0x03 /* * The target is not capable of * supporting a physical device on @@ -688,30 +706,39 @@ struct scsi_inquiry_data #define SID_QUAL2 0x7F #define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0) u_int8_t version; -#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) +#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) #define SCSI_REV_0 0 #define SCSI_REV_CCS 1 #define SCSI_REV_2 2 #define SCSI_REV_SPC 3 #define SCSI_REV_SPC2 4 +#define SCSI_REV_SPC3 5 +#define SCSI_REV_SPC4 6 -#define SID_ECMA 0x38 -#define SID_ISO 0xC0 +#define SID_ECMA 0x38 +#define SID_ISO 0xC0 u_int8_t response_format; -#define SID_AENC 0x80 -#define SID_TrmIOP 0x40 +#define SID_AENC 0x80 +#define SID_TrmIOP 0x40 u_int8_t additional_length; #define SID_ADDITIONAL_LENGTH(iqd) \ ((iqd)->additional_length + \ offsetof(struct scsi_inquiry_data, additional_length) + 1) - u_int8_t reserved; + u_int8_t spc3_flags; +#define SPC3_SID_PROTECT 0x01 +#define SPC3_SID_3PC 0x08 +#define SPC3_SID_TPGS_MASK 0x30 +#define SPC3_SID_TPGS_IMPLICIT 0x10 +#define SPC3_SID_TPGS_EXPLICIT 0x20 +#define SPC3_SID_ACC 0x40 +#define SPC3_SID_SCCS 0x80 u_int8_t spc2_flags; -#define SPC2_SID_MChngr 0x08 -#define SPC2_SID_MultiP 0x10 -#define SPC2_SID_EncServ 0x40 -#define SPC2_SID_BQueue 0x80 +#define SPC2_SID_MChngr 0x08 +#define SPC2_SID_MultiP 0x10 +#define SPC2_SID_EncServ 0x40 +#define SPC2_SID_BQueue 0x80 -#define INQ_DATA_TQ_ENABLED(iqd) \ +#define INQ_DATA_TQ_ENABLED(iqd) \ ((SID_ANSI_REV(iqd) < SCSI_REV_SPC2)? ((iqd)->flags & SID_CmdQue) : \ (((iqd)->flags & SID_CmdQue) && !((iqd)->spc2_flags & SPC2_SID_BQueue)) || \ (!((iqd)->flags & SID_CmdQue) && ((iqd)->spc2_flags & SPC2_SID_BQueue))) @@ -724,11 +751,11 @@ struct scsi_inquiry_data #define SID_WBus16 0x20 #define SID_WBus32 0x40 #define SID_RelAdr 0x80 -#define SID_VENDOR_SIZE 8 +#define SID_VENDOR_SIZE 8 char vendor[SID_VENDOR_SIZE]; -#define SID_PRODUCT_SIZE 16 +#define SID_PRODUCT_SIZE 16 char product[SID_PRODUCT_SIZE]; -#define SID_REVISION_SIZE 4 +#define SID_REVISION_SIZE 4 char revision[SID_REVISION_SIZE]; /* * The following fields were taken from SCSI Primary Commands - 2 @@ -769,10 +796,10 @@ struct scsi_vpd_supported_page_list { u_int8_t device; u_int8_t page_code; -#define SVPD_SUPPORTED_PAGE_LIST 0x00 +#define SVPD_SUPPORTED_PAGE_LIST 0x00 u_int8_t reserved; u_int8_t length; /* number of VPD entries */ -#define SVPD_SUPPORTED_PAGES_SIZE 251 +#define SVPD_SUPPORTED_PAGES_SIZE 251 u_int8_t list[SVPD_SUPPORTED_PAGES_SIZE]; }; @@ -780,10 +807,10 @@ struct scsi_vpd_unit_serial_number { u_int8_t device; u_int8_t page_code; -#define SVPD_UNIT_SERIAL_NUMBER 0x80 +#define SVPD_UNIT_SERIAL_NUMBER 0x80 u_int8_t reserved; u_int8_t length; /* serial number length */ -#define SVPD_SERIAL_NUM_SIZE 251 +#define SVPD_SERIAL_NUM_SIZE 251 u_int8_t serial_num[SVPD_SERIAL_NUM_SIZE]; }; @@ -860,6 +887,63 @@ struct scsi_report_luns_data { #define RPL_LUNDATA_ATYP_LUN 0x80 #define RPL_LUNDATA_ATYP_EXTLUN 0xc0 +struct scsi_target_group +{ + uint8_t opcode; + uint8_t service_action; +#define STG_PDF_LENGTH 0x00 +#define RPL_PDF_EXTENDED 0x20 + uint8_t reserved1[4]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_target_port_descriptor { + uint8_t reserved[2]; + uint8_t relative_target_port_identifier[2]; +}; + +struct scsi_target_port_group_descriptor { + uint8_t pref_state; +#define TPG_PRIMARY 0x80 +#define TPG_ASYMMETRIC_ACCESS_STATE_MASK 0xf +#define TPG_ASYMMETRIC_ACCESS_OPTIMIZED 0x0 +#define TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED 0x1 +#define TPG_ASYMMETRIC_ACCESS_STANDBY 0x2 +#define TPG_ASYMMETRIC_ACCESS_UNAVAILABLE 0x3 +#define TPG_ASYMMETRIC_ACCESS_LBA_DEPENDENT 0x4 +#define TPG_ASYMMETRIC_ACCESS_OFFLINE 0xE +#define TPG_ASYMMETRIC_ACCESS_TRANSITIONING 0xF + uint8_t support; +#define TPG_AO_SUP 0x01 +#define TPG_AN_SUP 0x02 +#define TPG_S_SUP 0x04 +#define TPG_U_SUP 0x08 +#define TPG_LBD_SUP 0x10 +#define TPG_O_SUP 0x40 +#define TPG_T_SUP 0x80 + uint8_t target_port_group[2]; + uint8_t reserved; + uint8_t status; + uint8_t vendor_specific; + uint8_t target_port_count; + struct scsi_target_port_descriptor descriptors[1]; +}; + +struct scsi_target_group_data { + uint8_t length[4]; /* length of returned data, in bytes */ + struct scsi_target_port_group_descriptor groups[1]; +}; + +struct scsi_target_group_data_extended { + uint8_t length[4]; /* length of returned data, in bytes */ + uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ + uint8_t implicit_transition_time; + uint8_t reserved[2]; + struct scsi_target_port_group_descriptor groups[1]; +}; + struct scsi_sense_data { @@ -898,12 +982,12 @@ struct scsi_sense_data u_int8_t fru; u_int8_t sense_key_spec[3]; #define SSD_SCS_VALID 0x80 -#define SSD_FIELDPTR_CMD 0x40 -#define SSD_BITPTR_VALID 0x08 -#define SSD_BITPTR_VALUE 0x07 -#define SSD_MIN_SIZE 18 +#define SSD_FIELDPTR_CMD 0x40 +#define SSD_BITPTR_VALID 0x08 +#define SSD_BITPTR_VALUE 0x07 +#define SSD_MIN_SIZE 18 u_int8_t extra_bytes[14]; -#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) +#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) }; struct scsi_mode_header_6 @@ -948,13 +1032,13 @@ struct scsi_mode_blk_desc #define SCSI_STATUS_CHECK_COND 0x02 #define SCSI_STATUS_COND_MET 0x04 #define SCSI_STATUS_BUSY 0x08 -#define SCSI_STATUS_INTERMED 0x10 -#define SCSI_STATUS_INTERMED_COND_MET 0x14 -#define SCSI_STATUS_RESERV_CONFLICT 0x18 -#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ -#define SCSI_STATUS_QUEUE_FULL 0x28 -#define SCSI_STATUS_ACA_ACTIVE 0x30 -#define SCSI_STATUS_TASK_ABORTED 0x40 +#define SCSI_STATUS_INTERMED 0x10 +#define SCSI_STATUS_INTERMED_COND_MET 0x14 +#define SCSI_STATUS_RESERV_CONFLICT 0x18 +#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ +#define SCSI_STATUS_QUEUE_FULL 0x28 +#define SCSI_STATUS_ACA_ACTIVE 0x30 +#define SCSI_STATUS_TASK_ABORTED 0x40 struct scsi_inquiry_pattern { u_int8_t type; @@ -1065,9 +1149,9 @@ int scsi_interpret_sense(struct cam_dev #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 -#define SF_NO_PRINT 0x02 -#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ -#define SF_PRINT_ALWAYS 0x08 +#define SF_NO_PRINT 0x02 +#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ +#define SF_PRINT_ALWAYS 0x08 const char * scsi_op_desc(u_int16_t opcode, @@ -1174,6 +1258,20 @@ void scsi_report_luns(struct ccb_scsiio u_int32_t alloc_len, u_int8_t sense_len, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat Jun 12 19:20:39 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B0F1065672; Sat, 12 Jun 2010 19:20:39 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9FDC8FC20; Sat, 12 Jun 2010 19:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CJKde2089888; Sat, 12 Jun 2010 19:20:39 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CJKdo5089886; Sat, 12 Jun 2010 19:20:39 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006121920.o5CJKdo5089886@svn.freebsd.org> From: Roman Divacky Date: Sat, 12 Jun 2010 19:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209111 - projects/clangbsd/contrib/llvm/tools/clang/lib/AST X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 19:20:40 -0000 Author: rdivacky Date: Sat Jun 12 19:20:39 2010 New Revision: 209111 URL: http://svn.freebsd.org/changeset/base/209111 Log: This has been fixed, revert the workaround. Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Sat Jun 12 17:32:05 2010 (r209110) +++ projects/clangbsd/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Sat Jun 12 19:20:39 2010 (r209111) @@ -1274,7 +1274,7 @@ bool IntExprEvaluator::VisitBinaryOperat // Reject any bases from the normal codepath; we special-case comparisons // to null. if (LHSValue.getLValueBase()) { -// if (!E->isEqualityOp()) + if (!E->isEqualityOp()) return false; if (RHSValue.getLValueBase() || !RHSValue.getLValueOffset().isZero()) return false; @@ -1283,7 +1283,7 @@ bool IntExprEvaluator::VisitBinaryOperat return false; return Success(bres ^ (E->getOpcode() == BinaryOperator::EQ), E); } else if (RHSValue.getLValueBase()) { -// if (!E->isEqualityOp()) + if (!E->isEqualityOp()) return false; if (LHSValue.getLValueBase() || !LHSValue.getLValueOffset().isZero()) return false; From owner-svn-src-projects@FreeBSD.ORG Sat Jun 12 20:08:02 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360541065674; Sat, 12 Jun 2010 20:08:02 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231028FC12; Sat, 12 Jun 2010 20:08:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CK82eV000460; Sat, 12 Jun 2010 20:08:02 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CK81Vi000451; Sat, 12 Jun 2010 20:08:01 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006122008.o5CK81Vi000451@svn.freebsd.org> From: Roman Divacky Date: Sat, 12 Jun 2010 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209113 - in projects/clangbsd/contrib/llvm/tools/clang: include/clang/Analysis/Analyses include/clang/Basic include/clang/Driver lib/Analysis lib/Driver lib/Frontend lib/Sema X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 20:08:02 -0000 Author: rdivacky Date: Sat Jun 12 20:08:01 2010 New Revision: 209113 URL: http://svn.freebsd.org/changeset/base/209113 Log: Sync the format extensions with head. Modified: projects/clangbsd/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h projects/clangbsd/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/Options.td projects/clangbsd/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp projects/clangbsd/contrib/llvm/tools/clang/lib/Driver/Tools.cpp projects/clangbsd/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp projects/clangbsd/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: projects/clangbsd/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h Sat Jun 12 20:08:01 2010 (r209113) @@ -308,7 +308,7 @@ public: }; bool ParseFormatString(FormatStringHandler &H, - const char *beg, const char *end); + const char *beg, const char *end, bool FormatExtensions); } // end printf namespace } // end clang namespace Modified: projects/clangbsd/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h Sat Jun 12 20:08:01 2010 (r209113) @@ -54,6 +54,7 @@ public: unsigned NeXTRuntime : 1; // Use NeXT runtime. unsigned Freestanding : 1; // Freestanding implementation + unsigned FormatExtensions : 1; // FreeBSD format extensions (-fformat-extensions) unsigned NoBuiltin : 1; // Do not use builtin functions (-fno-builtin) unsigned ThreadsafeStatics : 1; // Whether static initializers are protected Modified: projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td Sat Jun 12 20:08:01 2010 (r209113) @@ -377,6 +377,8 @@ def fsjlj_exceptions : Flag<"-fsjlj-exce HelpText<"Use SjLj style exceptions">; def ffreestanding : Flag<"-ffreestanding">, HelpText<"Assert that the compilation takes place in a freestanding environment">; +def fformat_extensions : Flag<"-fformat-extensions">, + HelpText<"FreeBSD printf format extensions">; def fgnu_runtime : Flag<"-fgnu-runtime">, HelpText<"Generate output compatible with the standard GNU Objective-C runtime">; def std_EQ : Joined<"-std=">, Modified: projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/Options.td Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/include/clang/Driver/Options.td Sat Jun 12 20:08:01 2010 (r209113) @@ -268,6 +268,7 @@ def fexceptions : Flag<"-fexceptions">, def fextdirs_EQ : Joined<"-fextdirs=">, Group; def fhosted : Flag<"-fhosted">, Group; def ffreestanding : Flag<"-ffreestanding">, Group; +def fformat_extensions: Flag<"-fformat-extensions">; def fgnu_keywords : Flag<"-fgnu-keywords">, Group; def fgnu_runtime : Flag<"-fgnu-runtime">, Group; def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Sat Jun 12 20:08:01 2010 (r209113) @@ -210,7 +210,8 @@ static bool ParseArgPosition(FormatStrin static FormatSpecifierResult ParseFormatSpecifier(FormatStringHandler &H, const char *&Beg, const char *E, - unsigned &argIndex) { + unsigned &argIndex, + bool FormatExtensions) { using namespace clang::analyze_printf; @@ -370,10 +371,10 @@ static FormatSpecifierResult ParseFormat // Glibc specific. case 'm': k = ConversionSpecifier::PrintErrno; break; // FreeBSD format extensions - case 'b': k = ConversionSpecifier::bArg; break; /* check for int and then char * */ - case 'r': k = ConversionSpecifier::xArg; break; - case 'y': k = ConversionSpecifier::iArg; break; - case 'D': k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ + case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ + case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break; + case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; + case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ } ConversionSpecifier CS(conversionPosition, k); FS.setConversionSpecifier(CS); @@ -391,13 +392,13 @@ static FormatSpecifierResult ParseFormat } bool clang::analyze_printf::ParseFormatString(FormatStringHandler &H, - const char *I, const char *E) { + const char *I, const char *E, bool FormatExtensions) { unsigned argIndex = 0; // Keep looking for a format specifier until we have exhausted the string. while (I != E) { - const FormatSpecifierResult &FSR = ParseFormatSpecifier(H, I, E, argIndex); + const FormatSpecifierResult &FSR = ParseFormatSpecifier(H, I, E, argIndex, FormatExtensions); // Did a fail-stop error of any kind occur when parsing the specifier? // If so, don't do any more processing. if (FSR.shouldStop()) Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jun 12 20:08:01 2010 (r209113) @@ -1156,6 +1156,7 @@ void Clang::ConstructJob(Compilation &C, Args.AddLastArg(CmdArgs, options::OPT_fcatch_undefined_behavior); Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); + Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions); // -flax-vector-conversions is default. if (!Args.hasFlag(options::OPT_flax_vector_conversions, Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Sat Jun 12 20:08:01 2010 (r209113) @@ -530,6 +530,8 @@ static void LangOptsToArgs(const LangOpt Res.push_back("-fgnu-runtime"); if (Opts.Freestanding) Res.push_back("-ffreestanding"); + if (Opts.FormatExtensions) + Res.push_back("-fformat-extensions"); if (Opts.NoBuiltin) Res.push_back("-fno-builtin"); if (!Opts.AssumeSaneOperatorNew) @@ -1245,6 +1247,7 @@ static void ParseLangArgs(LangOptions &O Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char); Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); Opts.Freestanding = Args.hasArg(OPT_ffreestanding); + Opts.FormatExtensions = Args.hasArg(OPT_fformat_extensions); Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); Opts.HeinousExtensions = true; Modified: projects/clangbsd/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- projects/clangbsd/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Jun 12 19:32:52 2010 (r209112) +++ projects/clangbsd/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Jun 12 20:08:01 2010 (r209113) @@ -1433,7 +1433,8 @@ void Sema::CheckPrintfString(const Strin isa(OrigFormatExpr), Str, HasVAListArg, TheCall, format_idx); - if (!analyze_printf::ParseFormatString(H, Str, Str + StrLen)) + bool FormatExtensions = getLangOptions().FormatExtensions; + if (!analyze_printf::ParseFormatString(H, Str, Str + StrLen, FormatExtensions)) H.DoneProcessing(); }