[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
- Re: [Qemu-devel] [PATCH 11/34] linux-user: Support for restarting system calls for SH4 targets, (continued)
- [Qemu-devel] [PATCH 27/34] linux-user: pause() should not pause if signal pending, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 05/34] linux-user: Support for restarting system calls for ARM targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 13/34] linux-user: Fix signal before blocking system calls race and SA_RESTART, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 30/34] linux-user: Support for restarting system calls for OpenRISC targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 29/34] linux-user: Support for restarting system calls for UniCore32 targets,
Timothy E Baldwin <=
- [Qemu-devel] [PATCH 12/34] linux-user: Support for restarting system calls for APLHA targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pending, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 23/34] linux-user: Queue synchronous signals separately, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 32/34] linux-user: Support for restarting system calls for S390 targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 22/34] linux-user: Remove real-time signal queuing, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 33/34] linux-user: Support for restarting system calls for CRIS targets, Timothy E Baldwin, 2015/09/05