Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk> --- linux-user/main.c | 3 +++ linux-user/signal.c | 2 +- linux-user/sparc/syscall.h | 2 ++ linux-user/sparc64/syscall.h | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c index 5e9e3a8..d47e33f 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1326,6 +1326,9 @@ void cpu_loop (CPUSPARCState *env) env->regwptr[2], env->regwptr[3], env->regwptr[4], env->regwptr[5], 0, 0); + if (ret == -TARGET_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) { + break; + } if ((abi_ulong)ret >= (abi_ulong)(-515)) { #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) env->xcc |= PSR_CARRY; diff --git a/linux-user/signal.c b/linux-user/signal.c index c8f288b..e432f97 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2458,7 +2458,7 @@ long do_sigreturn(CPUSPARCState *env) goto segv_and_exit; } unlock_user_struct(sf, sf_addr, 0); - return env->regwptr[0]; + return -TARGET_QEMU_ESIGRETURN; segv_and_exit: unlock_user_struct(sf, sf_addr, 0); diff --git a/linux-user/sparc/syscall.h b/linux-user/sparc/syscall.h index 58573b9..3844b59 100644 --- a/linux-user/sparc/syscall.h +++ b/linux-user/sparc/syscall.h @@ -18,3 +18,5 @@ struct target_pt_regs { #define TARGET_MINSIGSTKSZ 4096 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000 #define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#define TARGET_USE_ERESTARTSYS 1 diff --git a/linux-user/sparc64/syscall.h b/linux-user/sparc64/syscall.h index 8398d3f..0adc5ad 100644 --- a/linux-user/sparc64/syscall.h +++ b/linux-user/sparc64/syscall.h @@ -19,3 +19,5 @@ struct target_pt_regs { #define TARGET_MINSIGSTKSZ 4096 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000 #define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#define TARGET_USE_ERESTARTSYS 1 -- 2.1.4