aboutsummaryrefslogtreecommitdiff
path: root/common-user/safe-syscall.S
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-11-17 16:14:00 +0100
committerRichard Henderson <richard.henderson@linaro.org>2021-12-20 10:12:24 -0800
commitbbf15aaf7c7506c88062288b3ae122b882f65e69 (patch)
tree35c44f9cb40a66389e85da8afbb4fd65efc71af2 /common-user/safe-syscall.S
parent2ac16d01e371ba9fb268f04249eaca9fafceb00b (diff)
downloadqemu-bbf15aaf7c7506c88062288b3ae122b882f65e69.zip
qemu-bbf15aaf7c7506c88062288b3ae122b882f65e69.tar.gz
qemu-bbf15aaf7c7506c88062288b3ae122b882f65e69.tar.bz2
common-user: Move safe-syscall.* from linux-user
Move linux-user safe-syscall.S and safe-syscall-error.c to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Since there is nothing here that is related to the guest, as opposed to the host, build it once. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'common-user/safe-syscall.S')
-rw-r--r--common-user/safe-syscall.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/common-user/safe-syscall.S b/common-user/safe-syscall.S
new file mode 100644
index 0000000..74f7e35
--- /dev/null
+++ b/common-user/safe-syscall.S
@@ -0,0 +1,27 @@
+/*
+ * 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 "special-errno.h"
+
+/* We have the correct host directory on our include path
+ * so that this will pull in the right fragment for the architecture.
+ */
+#include "safe-syscall.inc.S"
+
+/* 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