[parisc-linux] Re: [parisc-linux-cvs] linux-2.6 jejb

Carlos O'Donell carlos at baldric.uwo.ca
Mon Aug 23 12:43:00 MDT 2004


On Wed, Aug 18, 2004 at 11:39:43AM -0400, John David Anglin wrote:

> To be more specific, I something like the following can be used both
> with PA 1.x which is always strongly ordered and PA 2.0:
> 
> #define __lock_reset(lock_addr,tmp) \
>   __asm__ __volatile__ ("stw,ma %1,0(%0)" \
> 			 : : "r" (lock_addr), "r" (tmp) : "memory");
> 
> where tmp should contain the unlocked value.  This is normally obtained
> when the lock is acquired.  The above also functions as a memory barrier.
> This relies on the fact that the "ma" completer with a displacement of
> zero is in fact the same as the PA 2.0 "co" completer.

glibc likes to push this into some higher layers:

     31   WRITE_MEMORY_BARRIER();
     32   *spinlock = __LT_SPINLOCK_INIT;
     33   __asm __volatile ("" : "=m" (*spinlock) : "m" (*spinlock));

Is this okay?

c.


More information about the parisc-linux-cvs mailing list