Subject: Re: ata/wdc vs gcc3 on amiga
To: Martin Husemann <martin@duskware.de>
From: Steve Woodford <scw@netbsd.org>
List: tech-kern
Date: 04/07/2004 12:42:19
On Wednesday 07 April 2004 12:35 pm, Martin Husemann wrote:
> On Wed, Apr 07, 2004 at 09:41:01AM +0300, Jukka Andberg wrote:
> > 2) chp->ch_flags is read into a register
> > 3) splx()
> > 4) wdcintr() runs, changing the ch_flags
>
> Should splx() imply a memory clobber?

No. That it does on some architectures is purely an implementation 
detail.

The right fix is to declare ch_flags to be volatile. Any variable shared 
between the top/bottom halves of a driver should be declared volatile 
unless there is a very good reason not to.

Cheers, Steve