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