From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel GUILLET Date: Wed, 05 Feb 2003 08:39:48 +0000 Subject: Re: [Linux-ia64] _raw_write_trylock() missing Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ia64@vger.kernel.org Hello, On Wed, 5 Feb 2003, Ian Wienand wrote: > On Tue, Feb 04, 2003 at 03:18:22PM +0100, Joel GUILLET wrote: > > What the macro is doing : (at least, what I think it is doing) > > > > - if the actual lock value is equal to "0", > > change the lock value to "00.....0001" Sorry for that mistake in my mail, but the value I actually want to store into the lock is the 32 bit value "1000000...000". ... because the rw_lock value is composed with : - 1 bit for the write "flag" (the most significant bit of a _long_ value) - 31 bits for the read flags ... so the value of r29 (0x80000000) should be OK. > > else do nothing > > > > The code for this : (in include/asm-ia64/spinlock.h) > > "dep r29 = -1, r0, 31, 1\n" > > doesn't this make the value of r29 0x80000000? i.e the 1 is at the > wrong end. > > > "cmpxchg4.acq result = [rw], r29, ar.ccv\n" > > so here you end up swapping 0x8000000 into rw if rw=0 > > i think maybe just making doing mov r29 = 1 above will do what you > want. > > -i > ianw@gelato.unsw.edu.au > http://www.gelato.unsw.edu.au > > _______________________________________________ > Linux-IA64 mailing list > Linux-IA64@linuxia64.org > http://lists.linuxia64.org/lists/listinfo/linux-ia64 >