Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jun 2010 21:38:30 -0600
From:      Scott Long <scottl@samsco.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
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
Message-ID:  <516EEDC6-069A-4780-84DF-BBFF43ABCDE5@samsco.org>
In-Reply-To: <20100605.203348.651115405925906974.imp@bsdimp.com>
References:  <201006052041.o55KfMF6032155@svn.freebsd.org> <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com> <20100605.203348.651115405925906974.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 5, 2010, at 8:33 PM, M. Warner Losh wrote:
> In message: <184A275D-B98A-4DBF-9F4D-22F27B9319DD@mac.com>
>            Marcel Moolenaar <xcllnt@mac.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?516EEDC6-069A-4780-84DF-BBFF43ABCDE5>