aboutsummaryrefslogtreecommitdiff
path: root/linux-user/safe-syscall.S
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-05-27 14:05:48 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-05-27 14:05:48 +0100
commitd6550e9ed2e1a60d889dfb721de00d9a4e3bafbe (patch)
tree3ab1161c8e63c202cbd207cfb10e1e37ec206951 /linux-user/safe-syscall.S
parent34c99d7b93c9181aa8c426300beca130b2b19e39 (diff)
parent49e55cbacf4ad08f831b9f3f9cb0f3082883a3a1 (diff)
Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160527' into staging
linux-user pull request v2 for may 2016 # gpg: Signature made Fri 27 May 2016 12:51:10 BST using RSA key ID DE3C9BC0 # gpg: Good signature from "Riku Voipio <riku.voipio@iki.fi>" # gpg: aka "Riku Voipio <riku.voipio@linaro.org>" * remotes/riku/tags/pull-linux-user-20160527: (38 commits) linux-user,target-ppc: fix use of MSR_LE linux-user/signal.c: Use s390 target space address instead of host space linux-user/signal.c: Use target address instead of host address for microblaze restorer linux-user/signal.c: Generate opcode data for restorer in setup_rt_frame linux-user: arm: Remove ARM_cpsr and similar #defines linux-user: Use direct syscalls for setuid(), etc linux-user: x86_64: Don't use 16-bit UIDs linux-user: Use g_try_malloc() in do_msgrcv() linux-user: Handle msgrcv error case correctly linux-user: Handle negative values in timespec conversion linux-user: Use safe_syscall for futex syscall linux-user: Use safe_syscall for pselect, select syscalls linux-user: Use safe_syscall for execve syscall linux-user: Use safe_syscall for wait system calls linux-user: Use safe_syscall for open and openat system calls linux-user: Use safe_syscall for read and write system calls linux-user: Provide safe_syscall for fixing races between signals and syscalls linux-user: Add debug code to exercise restarting system calls linux-user: Support for restarting system calls for Microblaze targets linux-user: Set r14 on exit from microblaze syscall ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/safe-syscall.S')
-rw-r--r--linux-user/safe-syscall.S30
1 files changed, 30 insertions, 0 deletions
diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S
new file mode 100644
index 0000000000..b5df6254ae
--- /dev/null
+++ b/linux-user/safe-syscall.S
@@ -0,0 +1,30 @@
+/*
+ * safe-syscall.S : include the host-specific assembly fragment
+ * to handle signals occurring at the same time as system calls.
+ *
+ * Written by Peter Maydell <peter.maydell@linaro.org>
+ *
+ * Copyright (C) 2016 Linaro Limited
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "hostdep.h"
+#include "errno_defs.h"
+
+/* We have the correct host directory on our include path
+ * so that this will pull in the right fragment for the architecture.
+ */
+#ifdef HAVE_SAFE_SYSCALL
+#include "safe-syscall.inc.S"
+#endif
+
+/* We must specifically say that we're happy for the stack to not be
+ * executable, otherwise the toolchain will default to assuming our
+ * assembly needs an executable stack and the whole QEMU binary will
+ * needlessly end up with one. This should be the last thing in this file.
+ */
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack, "", %progbits
+#endif