Re: [Linux-ia64] _raw_write_trylock() missing

From: Ian Wienand <ianw_at_gelato.unsw.edu.au>
Date: 2003-02-05 12:46:37
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"
> 	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
Received on Tue Feb 04 17:46:50 2003

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