diff mbox

[v2,04/28] linux-user: Define TARGET_ERESTART* errno values

Message ID 1463075272-9933-5-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell May 12, 2016, 5:47 p.m. UTC
From: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>

Define TARGET_ERESTARTSYS; like the kernel, we will use this to
indicate that a guest system call should be restarted. We use
the same value the kernel does for this, 512.

Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
[PMM: split out from the patch which moves and renumbers
 TARGET_QEMU_ESIGRETURN, add comment on usage]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/errno_defs.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Laurent Vivier May 24, 2016, 9:42 a.m. UTC | #1
Le 12/05/2016 à 19:47, Peter Maydell a écrit :
> From: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
> 
> Define TARGET_ERESTARTSYS; like the kernel, we will use this to
> indicate that a guest system call should be restarted. We use
> the same value the kernel does for this, 512.
> 
> Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
> [PMM: split out from the patch which moves and renumbers
>  TARGET_QEMU_ESIGRETURN, add comment on usage]
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

> ---
>  linux-user/errno_defs.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/linux-user/errno_defs.h b/linux-user/errno_defs.h
> index 8a1cf76..b7a8c9f 100644
> --- a/linux-user/errno_defs.h
> +++ b/linux-user/errno_defs.h
> @@ -139,3 +139,11 @@
>  /* for robust mutexes */
>  #define TARGET_EOWNERDEAD      130     /* Owner died */
>  #define TARGET_ENOTRECOVERABLE 131     /* State not recoverable */
> +
> +/* QEMU internal, not visible to the guest. This is returned when a
> + * system call should be restarted, to tell the main loop that it
> + * should wind the guest PC backwards so it will re-execute the syscall
> + * after handling any pending signals. They match with the ones the guest
> + * kernel uses for the same purpose.
> + */
> +#define TARGET_ERESTARTSYS     512     /* Restart system call (if SA_RESTART) */
>
diff mbox

Patch

diff --git a/linux-user/errno_defs.h b/linux-user/errno_defs.h
index 8a1cf76..b7a8c9f 100644
--- a/linux-user/errno_defs.h
+++ b/linux-user/errno_defs.h
@@ -139,3 +139,11 @@ 
 /* for robust mutexes */
 #define TARGET_EOWNERDEAD      130     /* Owner died */
 #define TARGET_ENOTRECOVERABLE 131     /* State not recoverable */
+
+/* QEMU internal, not visible to the guest. This is returned when a
+ * system call should be restarted, to tell the main loop that it
+ * should wind the guest PC backwards so it will re-execute the syscall
+ * after handling any pending signals. They match with the ones the guest
+ * kernel uses for the same purpose.
+ */
+#define TARGET_ERESTARTSYS     512     /* Restart system call (if SA_RESTART) */