Subject: Re: USB stack needs early review (Re: Someone should fix our USB stack...)
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-kern
Date: 04/26/2007 14:57:31
der Mouse <mouse@Rodents.Montreal.QC.CA> writes:
>>> How could be spl() implemented to avoid the need for volatiles?
>> It needs to have a memory clobber + __insn_barrier().
>
> How would that avoid the ned for volatile marking on stuff shared
> between driver top half and driver bottom half? You still need
> volatile to prevent the compiler from generating code assuming that,
> for example, successive reads without stores in between will return the
> same value, or that stores can be deferred without harm.
I don't believe we're talking about true memory-mapped device
registers; we're talking about RAM that the device is allowed to write
to at specific points, between known handoffs. Given DMA sync
operations at those handoffs, the compiler may merrily treat the
memory as being, in fact, memory-like.
- Nathan