Subject: Re: PCI-audio & endianness (eso.c/mulaw.c)
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 10/27/1999 11:18:12
At 10:45 AM 10/27/99 , Jason Thorpe wrote:
>On Wed, 27 Oct 1999 09:17:31 -0700 (PDT)
> eeh@one-o.com (Eduardo E. Horvath) wrote:
>
> > > I guess most PCI bus-master devices assume the host is little endian,
> > > so bswap*() functions are needed on passing non-bytestream data via DMA.
> > > (i.e. on accessing variables allocated by bus_dmamem_alloc(9) and
> > > bus_dmamem_map(9))
> >
> > Once again this should be handled by bus_space(9) macros. We may need
> > to add some new ones specifically for the host to access DMA memory,
> > if it's only being mapped in once and used statically as an area for
> > host/device communication.
>
>Since it's obviously not "bus space", random memory being DMA'd to a
>device can't be handled with bus_space(9).
But it can be handled by bus_dma(9). Specifically, bus_dma_sync can
do any required endian conversions.
--
Matt Thomas Internet: matt@3am-software.com
3am Software Foundry WWW URL: http://www.3am-software.com/bio/matt/
Cupertino, CA Disclaimer: I avow all knowledge of this message