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

John David Anglin dave at hiauly1.hia.nrc.ca
Wed Aug 18 09:39:43 MDT 2004


> > PA20 arch allows weakly ordered mem.
> > John Marvin was clear all implementations are strongly ordered.
> > (See the mail archive for discussion about this)
> 
> I still believe that we should reset the lock with a coherent store
> as it doesn't cost anything to do it right.

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.

Dave
-- 
J. David Anglin                                  dave.anglin at nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


More information about the parisc-linux-cvs mailing list