[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/11] [v2] linux-user: implement m68k atomic syscal
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 10/11] [v2] linux-user: implement m68k atomic syscalls |
Date: |
Fri, 27 Sep 2013 15:10:05 +0300 |
From: Riku Voipio <address@hidden>
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).
[v2] que an segfault instead of returning a EFAULT
to keep in line with kernel code.
Cc: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/strace.list | 6 ++++++
linux-user/syscall.c | 28 ++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 4f9c364..cf5841a 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1521,3 +1521,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 aebe36d..b3822b3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9133,6 +9133,34 @@ 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)) {
+ target_siginfo_t info;
+ info.si_signo = SIGSEGV;
+ info.si_errno = 0;
+ info.si_code = TARGET_SEGV_MAPERR;
+ info._sifields._sigfault._addr = arg6;
+ queue_signal((CPUArchState *)cpu_env, info.si_signo, &info);
+ ret = 0xdeadbeef;
+
+ }
+ 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
- [Qemu-devel] [PULL] [PATCH 00/11] Linux-user updates, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 01/11] alpha-linux-user: Fix umount syscall numbers, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 03/11] linux-user: convert /proc/net/route when endianess differs, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 05/11] linux-user: allow use of TIOCGSID, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 02/11] mips-linux-user: Adjust names in mips_syscall_args, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 04/11] linux-user: Add setsockopt(SO_ATTACH_FILTER), riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 08/11] linux-user: correct how SOL_SOCKET is converted from target to host and back, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 09/11] linux-user: Check type of microMIPS break instruction, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 10/11] [v2] linux-user: implement m68k atomic syscalls,
riku . voipio <=
- [Qemu-devel] [PATCH 07/11] linux-user: add support of binfmt_misc 'O' flag, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 11/11] linux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host, riku . voipio, 2013/09/27
- [Qemu-devel] [PATCH 06/11] linux-user: add some IPV6 commands in setsockop(), riku . voipio, 2013/09/27
- Re: [Qemu-devel] [PULL] [PATCH 00/11] Linux-user updates, Edgar E. Iglesias, 2013/09/27