On Thu, 7 Sep 2000, Jamie Lokier wrote: > asm *__volatile__* seems to make no difference. I've tried a few things. > > Andrea Arcangeli wrote: > > Maybe we can rely on the __volatile__ statement of the asm that will > > enforce that if we write: > > > > *p = 0; > > __asm__ __volatile__("" : :); > > *p = 1; > > > > in the assembler we'll then find both a write of 0 and then a write of 1 > > to memory. > > That does 2 writes with gcc-2.96 and also egcs-2.91.66/19990314 > (Red Hat's kgcc), with or without -fstrict-aliasing. > > It also does 2 writes without __volatile__. Your test is broken. Read the gcc documentation. A inline asm with no outputs is implicitly considered volatile. So _both_ your tests had volatile there. Now, that may not matter that much fo ryour test-case: gcc gets careful around inline asm anyway, even without the volatile. Change it to something like __asm__("":"=r" (x):"0" (x)); and the "volatile" should matter. Not for memory references, perhaps. But for the movement issues. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
- Re: spin_lock forgets to clobber memory and other smp fix... Franz Sirl
- Re: spin_lock forgets to clobber memory and other sm... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and other smp fix... Jamie Lokier
- Re: spin_lock forgets to clobber memory and other sm... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and othe... Jamie Lokier
- Re: spin_lock forgets to clobber memory and ... Linus Torvalds
- Re: spin_lock forgets to clobber memory ... Jamie Lokier
- Re: spin_lock forgets to clobber memory and ... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory ... Jamie Lokier
- Re: spin_lock forgets to clobber memory ... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and other sm... Linus Torvalds
- Re: spin_lock forgets to clobber memory and othe... Jamie Lokier
- Re: spin_lock forgets to clobber memory and other smp fix... Linus Torvalds
- Re: spin_lock forgets to clobber memory and other sm... Jamie Lokier
- Re: spin_lock forgets to clobber memory and othe... Linus Torvalds
- Re: spin_lock forgets to clobber memory and othe... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and ... Jamie Lokier
- Re: spin_lock forgets to clobber memory ... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and ... David Woodhouse
- Re: spin_lock forgets to clobber memory ... Andrea Arcangeli
- Re: spin_lock forgets to clobber memory and other smp fix... kuznet