Signed-off-by: Timothy Edward Baldwin <[email protected]>
---
linux-user/main.c | 4 ++++
linux-user/ppc/syscall.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 124e9cc..5e9e3a8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1948,6 +1948,10 @@ void cpu_loop(CPUPPCState *env)
ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4],
env->gpr[5], env->gpr[6], env->gpr[7],
env->gpr[8], 0, 0);
+ if (ret == (target_ulong)(-TARGET_ERESTARTSYS)) {
+ env->nip -= 4;
+ break;
+ }
if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) {
/* Returning from a successful sigreturn syscall.
Avoid corrupting register state. */
diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h
index 532cbbd..e75da7f 100644
--- a/linux-user/ppc/syscall.h
+++ b/linux-user/ppc/syscall.h
@@ -71,3 +71,5 @@ struct target_revectored_struct {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_MLOCKALL_MCL_CURRENT 0x2000
#define TARGET_MLOCKALL_MCL_FUTURE 0x4000
+
+#define TARGET_USE_ERESTARTSYS 1
--
2.1.4