On 24/11/11 02:23, Richard Henderson wrote: > On 11/23/2011 04:00 PM, Joseph S. Myers wrote: >> On Wed, 23 Nov 2011, Richard Henderson wrote: >> >>> + __asm volatile ("swi %1" >>> + : "+r"(sc_0) >>> + : "i"(SYS_futex), "r"(sc_1), "r"(sc_2), "r"(sc_3) >>> + : "memory"); >> >> That looks wrong. Passing the syscall number to swi is the old-ABI >> approach; the EABI uses syscall number in r7. >
Which gets even more interesting in Thumb because r7 is what GCC thinks is the frame pointer register :-( > Interesting to know. > > I took as examples both glibc ports sysdeps.h and CLEAR_INSN_CACHE from > linux-gas.h. Which... I see is out of date wrt libgcc lib1funcs.S > clear_cache. > > Perhaps I'm better off with the syscall function as libgomp uses? That's probably the best solution on ARM. R.