Subject: Re: Driver for hardware sensors in G4 iBooks and probably
To: netbsd-macppc <port-macppc@NetBSD.org>
From: Matt Thomas <matt@3am-software.com>
List: port-macppc
Date: 12/13/2004 19:01:48
At 05:50 PM 12/13/2004, Michael wrote:
>Hello,
>
> > > snapper_softc has a bunch of DMA descriptors that need to be 16-byte
> > > aligned - apparently struct device gained 4 bytes so the alignment
> > > was toast. Moved one 4-byte field behind the DMA stuff and it
> > > works. Sort of - xmms hangs now and then, apparently at random -
> > > I'll see if I can catch it in gdb.
> >
> > If something needs to be aligned, it should be deliberately forced to
> > that alignment, not just tweaked until it works.
>
>Sure. That leads to my newbie-question - where and how are the device 
>structs allocated? I think they get some sort of well-defined alignment 
>then? Maybe these things should be allocated separately to avoid alignment 
>mismatches in the future.

Descriptors should not go in a device's softc; they should be allocated
using bus_dmamem/bus_dma with the right alignment.


-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.