Re: alpha: half done futex implementation

2009-04-14 Thread Segher Boessenkool
If either the lwarx or the stwcx. faults, the routine returns -EFAULT and doesn't retry (label "3" is the end of the asm). If the stwcx. fails because the CPU lost the reservation, %1 isn't clobbered as far as I see? Oh, "insn" writes to %1, never mind. Segher ___

Re: alpha: half done futex implementation

2009-04-14 Thread Segher Boessenkool
Also, there's a bug in the powerpc implementation. It appears that oparg is clobbered, and if stwcx fails the operation will be repeated with incorrect inputs. If either the lwarx or the stwcx. faults, the routine returns -EFAULT and doesn't retry (label "3" is the end of the asm). If the s

Re: alpha: half done futex implementation

2009-04-13 Thread Richard Henderson
Andreas Schwab wrote: Richard Henderson writes: switch (op) { case FUTEX_OP_SET: __futex_atomic_op("mov %0,%1", ret, oldval, uaddr, oparg); That should probably be "mov %4,%1\n"? You're right. r~ ___ Linuxppc-dev mailing list Linuxp

Re: alpha: half done futex implementation

2009-04-13 Thread Andreas Schwab
Richard Henderson writes: > switch (op) { > case FUTEX_OP_SET: > __futex_atomic_op("mov %0,%1", ret, oldval, uaddr, oparg); That should probably be "mov %4,%1\n"? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276

Re: alpha: half done futex implementation

2009-04-13 Thread Richard Henderson
Matt Turner wrote: Hi, Going on Richard's advice, I've tried to write an alpha futex implementation based on the powerpc futex.h. I've gotten this far.. :\ #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ __asm__ __volatile( \ __ASM_MB