Date: Thu, 10 Oct 2002 07:20:51 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Nate Lawson <nate@root.org> Cc: Andrew Gallatin <gallatin@cs.duke.edu>, <current@FreeBSD.ORG> Subject: Re: alpha tinderbox failure Message-ID: <20021010070525.O6622-100000@gamplex.bde.org> In-Reply-To: <Pine.BSF.4.21.0210091139120.14413-100000@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021010070525.O6622-100000>