qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 29/34] linux-user: Support for restarting system cal


From: Timothy E Baldwin
Subject: [Qemu-devel] [PATCH 29/34] linux-user: Support for restarting system calls for UniCore32 targets
Date: Sun, 6 Sep 2015 00:57:23 +0100

Signed-off-by: Timothy Edward Baldwin <address@hidden>
---

WARNING - NOT TESTED

 linux-user/main.c              | 7 ++++++-
 linux-user/unicore32/syscall.h | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index d86751a..9ca1c99 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1120,7 +1120,7 @@ void cpu_loop(CPUUniCore32State *env)
                             cpu_set_tls(env, env->regs[0]);
                             env->regs[0] = 0;
                     } else {
-                        env->regs[0] = do_syscall(env,
+                        abi_long ret = do_syscall(env,
                                                   n,
                                                   env->regs[0],
                                                   env->regs[1],
@@ -1129,6 +1129,11 @@ void cpu_loop(CPUUniCore32State *env)
                                                   env->regs[4],
                                                   env->regs[5],
                                                   0, 0);
+                        if (ret == -TARGET_ERESTARTSYS) {
+                            env->regs[31] -= 4;
+                        } else if (ret != -TARGET_QEMU_ESIGRETURN) {
+                            env->regs[0] = ret;
+                        }
                     }
                 } else {
                     goto error;
diff --git a/linux-user/unicore32/syscall.h b/linux-user/unicore32/syscall.h
index 385a975..4887d06 100644
--- a/linux-user/unicore32/syscall.h
+++ b/linux-user/unicore32/syscall.h
@@ -58,3 +58,5 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
 #endif /* __UC32_SYSCALL_H__ */
+
+#define TARGET_USE_ERESTARTSYS 1
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]