[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/34] linux-user: Support for restarting system cal
From: |
Timothy E Baldwin |
Subject: |
[Qemu-devel] [PATCH 03/34] linux-user: Support for restarting system calls |
Date: |
Sun, 6 Sep 2015 00:56:57 +0100 |
This allows SA_RESTART to be supported along with various case
where pending signals need to be handled before a system call.
New macro TARGET_ERESTARTSYS which is the error code used by Linux
to indicate that system call should be restarted.
TARGET_QEMU_ESIGRETURN moved into errno_defs.h and renumbered to
513 which is safe from future use as a system call return value
as it is used for system call restarting in Linux and exposed only
via ptrace.
do_sigreturn() and do_rt_sigreturn() will be amended to return
-TARGET_QEMU_ESIGRETURN rather than the value of result register to
avoid confusion with -TARGET_ERESTARTSYS and cpu_loop() will be
altered to act upon the return value accordingly.
Signed-off-by: Timothy Edward Baldwin <address@hidden>
---
linux-user/errno_defs.h | 3 +++
linux-user/mips/syscall.h | 4 ----
linux-user/mips64/syscall.h | 4 ----
linux-user/ppc/syscall.h | 2 --
4 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/linux-user/errno_defs.h b/linux-user/errno_defs.h
index 8a1cf76..a385f50 100644
--- a/linux-user/errno_defs.h
+++ b/linux-user/errno_defs.h
@@ -139,3 +139,6 @@
/* for robust mutexes */
#define TARGET_EOWNERDEAD 130 /* Owner died */
#define TARGET_ENOTRECOVERABLE 131 /* State not recoverable */
+
+#define TARGET_ERESTARTSYS 512 /* Restart system call */
+#define TARGET_QEMU_ESIGRETURN 513 /* Return from signal */
diff --git a/linux-user/mips/syscall.h b/linux-user/mips/syscall.h
index 35ca23b..e34f80c 100644
--- a/linux-user/mips/syscall.h
+++ b/linux-user/mips/syscall.h
@@ -220,10 +220,6 @@ struct target_pt_regs {
#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */
-
-/* Nasty hack: define a fake errno value for use by sigreturn. */
-#define TARGET_QEMU_ESIGRETURN 255
-
#define UNAME_MACHINE "mips"
#define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/mips64/syscall.h b/linux-user/mips64/syscall.h
index 6733107..33afb8d 100644
--- a/linux-user/mips64/syscall.h
+++ b/linux-user/mips64/syscall.h
@@ -217,10 +217,6 @@ struct target_pt_regs {
#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */
-
-/* Nasty hack: define a fake errno value for use by sigreturn. */
-#define TARGET_QEMU_ESIGRETURN 255
-
#define UNAME_MACHINE "mips64"
#define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h
index 0daf5cd..532cbbd 100644
--- a/linux-user/ppc/syscall.h
+++ b/linux-user/ppc/syscall.h
@@ -50,8 +50,6 @@ struct target_revectored_struct {
abi_ulong __map[8]; /* 256 bits */
};
-/* Nasty hack: define a fake errno value for use by sigreturn. */
-#define TARGET_QEMU_ESIGRETURN 255
/*
* flags masks
--
2.1.4
- [Qemu-devel] [PATCH 00/34] linux-user: Fix signal race conditions and SA_RESTART, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 01/34] linux-user: Fix array bounds in errno conversion, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 04/34] linux-user: Support for restarting system calls for x86 targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 06/34] linux-user: Support for restarting system calls for MIPS targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 03/34] linux-user: Support for restarting system calls,
Timothy E Baldwin <=
- [Qemu-devel] [PATCH 09/34] linux-user: Test for restarting system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 19/34] linux-user: Restart fork() if signals pending, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno() calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 17/34] linux-user: Use safe_syscall for wait system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 21/34] linux-user: Remove redundant gdb_queuesig(), Timothy E Baldwin, 2015/09/05