From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tDe-0006BU-Us for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1tDW-0005Xh-NF for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:10:42 -0400 Received: from afflict.kos.to ([92.243.29.197]:45483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tDW-0005Xb-Dp for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:10:34 -0400 Received: from kos.to (a91-156-63-85.elisa-laajakaista.fi [91.156.63.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 1F1502654F for ; Wed, 24 Jul 2013 09:10:33 +0200 (CEST) From: riku.voipio@linaro.org Date: Wed, 24 Jul 2013 10:10:31 +0300 Message-Id: <1374649831-5656-1-git-send-email-riku.voipio@linaro.org> Subject: [Qemu-devel] [RFC] [PATCH] linux-user: implement m68k atomic syscalls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , Laurent Vivier From: Riku Voipio With nptl enabled, atomic_cmpxchg_32 and atomic_barrier system calls are needed. This patch enabled really dummy versions of the system calls, modeled after the m68k kernel code. With this patch I am able to execute m68k binaries with qemu linux-user (busybox compiled for coldfire). Cc: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/strace.list | 6 ++++++ linux-user/syscall.c | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 08f115d..4377365 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1524,3 +1524,9 @@ #ifdef TARGET_NR_pipe2 { TARGET_NR_pipe2, "pipe2", NULL, NULL, NULL }, #endif +#ifdef TARGET_NR_atomic_cmpxchg_32 +{ TARGET_NR_atomic_cmpxchg_32, "atomic_cmpxchg_32", NULL, NULL, NULL }, +#endif +#ifdef TARGET_NR_atomic_barrier +{ TARGET_NR_atomic_barrier, "atomic_barrier", NULL, NULL, NULL }, +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3f6db4b..a98cec5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8990,6 +8990,26 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; } #endif +#ifdef TARGET_NR_atomic_cmpxchg_32 + case TARGET_NR_atomic_cmpxchg_32: + { + /* should use start_exclusive from main.c */ + abi_ulong mem_value; + if (get_user_u32(mem_value, arg6)) + ret = -TARGET_EFAULT; + if (mem_value == arg2) + put_user_u32(arg1, arg6); + ret = mem_value; + break; + } +#endif +#ifdef TARGET_NR_atomic_barrier + case TARGET_NR_atomic_barrier: + { + /* Like the kernel implementation and the qemu arm barrier, no-op this? */ + break; + } +#endif default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); -- 1.8.1.2