Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk> ---
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