From owner-freebsd-current Wed Oct 9 14:10:54 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE38A37B401 for ; Wed, 9 Oct 2002 14:10:52 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B185B43E4A for ; Wed, 9 Oct 2002 14:10:51 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id HAA26537; Thu, 10 Oct 2002 07:10:45 +1000 Date: Thu, 10 Oct 2002 07:20:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nate Lawson Cc: Andrew Gallatin , Subject: Re: alpha tinderbox failure In-Reply-To: Message-ID: <20021010070525.O6622-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 9 Oct 2002, Nate Lawson wrote: > On Wed, 9 Oct 2002, Andrew Gallatin wrote: > > ... > > Clashing with int nsegments: > > > > Sparc64 has the same problem. ia64 gets around it by just making > > BUS_SPACE_UNRESTRICTED an int: > > > > #define BUS_SPACE_UNRESTRICTED (~0) > > > > I'd like to do the same for alpha. I think this is valid, as > > BUS_SPACE_UNRESTRICTED seems to be used exlusively as an argument > > to bus_dma_tag_create(... nsegments = BUS_SPACE_UNRESTRICTED...) > > Yes, I looked into this before and agree this is a valid approach. It's > likely the number of segments never exceeds 32, let alone 2^31. However, it is likely that the number of segments exeeds ~0 (which is -1 on normal 2's complement machines). bus_dma_tag_create() has a bogus interface. It takes an "int nsegments" arg but corrupts it immediately to a "u_int nsegments" struct member. BUS_SPACE_UNRESTRICTED seems to be used as a generic (null) limit in at least the isp driver. It is not clear that ~0 has the correct overflow and sign extension behaviour for this. ~0UL works better as a generic limit. It even points to the bogus interface. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message