From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNd-0007IA-Pt for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6HNc-00019W-Q9 for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:45 -0400 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:34448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNc-000193-IZ for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:44 -0400 Received: by mail-lb0-x22c.google.com with SMTP id sh2so31744704lbb.1 for ; Fri, 27 May 2016 06:00:44 -0700 (PDT) From: riku.voipio@linaro.org Date: Fri, 27 May 2016 16:00:00 +0300 Message-Id: <6db9d00e2f05db0dfcc1a4d8b811fdd40170c91c.1464353863.git.riku.voipio@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PULL v2 09/38] linux-user: Support for restarting system calls for PPC targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Timothy E Baldwin From: Timothy E Baldwin Update the PPC main loop code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn (We already handle TARGET_QEMU_ESIGRETURN.) Signed-off-by: Timothy Edward Baldwin Message-id: 1441497448-32489-8-git-send-email-T.E.Baldwin99@members.leeds.ac.uk Reviewed-by: Peter Maydell [PMM: tweak commit message; drop TARGET_USE_ERESTARTSYS define] Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 4 ++++ linux-user/ppc/target_signal.h | 1 + 2 files changed, 5 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 73e3668..dfc098f 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1987,6 +1987,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_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/target_signal.h b/linux-user/ppc/target_signal.h index a93b5cf..4f01dd4 100644 --- a/linux-user/ppc/target_signal.h +++ b/linux-user/ppc/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state) return state->gpr[1]; } + #endif /* TARGET_SIGNAL_H */ -- 2.1.4