Subject: Re: non-swapping bus_space_read/write()
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 03/19/2004 00:13:57
On Thu, Mar 18, 2004 at 06:07:01PM -0500, Nathan J. Williams wrote:
> Manuel Bouyer <bouyer@antioche.eu.org> writes:
> 
> > > I finally fixed the if_ti driver to work on big-endian systems.
> > > The problem was quite simple: bus_space_read/write4() convert data
> > > to little-endian (which is expected as it's a PCI bus), but the tigon
> > > can run in big-endian mode.
> 
> What's the benefit of running the tigon in big-endian mode in the
> first place?

You don't have to swap everything you give to the chip (like adresses
in DMA descriptors, status registers, etc ...). You can save a few cycle
here.

> 
> Since PCI is mostly little-endian, making the responsible drivers
> byte-swap for devices that are behaving "oddly" with respect to PCI
> seems reasonable, though.

Well, the bus_space API already allows this, I didn't read the man page
carefully enouth :(

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--