This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libitm] Port to ARM
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, richard dot earnshaw at arm dot com, ramana dot radhakrishnan at arm dot com
- Date: Thu, 24 Nov 2011 00:00:56 +0000 (UTC)
- Subject: Re: [libitm] Port to ARM
- References: <4ECD8605.4080202@redhat.com>
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
joseph@codesourcery.com