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. Maybe this works in EABI code if the kernel has CONFIG_OABI_COMPAT enabled, but you can't rely on CONFIG_OABI_COMPAT being enabled (and decoding the instruction is slower, which is why this changed for EABI); you need to pass the number in r7 (easier from a pure assembly function, to avoid problems with it being used as the Thumb frame pointer) for EABI. (It's probably time to deprecate the old-ABI targets with EABI equivalents (arm*-*-linux* not matching arm*-*-linux-*eabi, arm*-*-uclinux* not matching arm*-*-uclinux*eabi, arm*-*-elf not matching arm*-*-ecos-elf, arm*-*-rtems* not matching arm*-*-rtemseabi*).) -- Joseph S. Myers jos...@codesourcery.com