Re: [Linux-ia64] _raw_write_trylock() missing

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2003-03-05 06:57:53
>>>>> On Tue, 4 Feb 2003 15:18:22 +0100 (NFT), Joel GUILLET <Joel.Guillet@bull.net> said:

  Joel> Here is an implementation of "_raw_write_trylock_ " needed for
  Joel> preemption support with SMP.  I tested it on a 2.5.59 kernel
  Joel> with 2 Itaniums. It seems to work.

I included your change, after dropping the (unnecessary) clobber of r2
and and the label (final result is below).  Let me know if you have
any issue with this.

Thanks,

	--david

#define _raw_spin_trylock(x)								\
({											\
	register long result;								\
											\
	__asm__ __volatile__ (								\
		"mov ar.ccv=r0\n"							\
		";;\n"									\
		"cmpxchg4.acq %0=[%2],%1,ar.ccv\n"					\
		: "=r"(result) : "r"(1), "r"(&(x)->lock) : "ar.ccv", "memory");		\
	(result == 0);									\
})
Received on Tue Mar 04 11:59:34 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:12 EST