From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0usM-0003sK-9I for qemu-devel@nongnu.org; Thu, 12 May 2016 13:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0usJ-0005Uz-V5 for qemu-devel@nongnu.org; Thu, 12 May 2016 13:58:17 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:56989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0usJ-0005Uq-OY for qemu-devel@nongnu.org; Thu, 12 May 2016 13:58:15 -0400 From: Peter Maydell Date: Thu, 12 May 2016 18:47:32 +0100 Message-Id: <1463075272-9933-9-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1463075272-9933-1-git-send-email-peter.maydell@linaro.org> References: <1463075272-9933-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 08/28] linux-user: Support for restarting system calls for MIPS targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, Timothy Edward Baldwin , Riku Voipio , Richard Henderson From: Timothy E Baldwin Update the MIPS 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-7-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 --- linux-user/main.c | 4 ++++ linux-user/mips/target_signal.h | 1 + linux-user/mips64/target_signal.h | 1 + 3 files changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 59c1166..0a8b7b6 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2527,6 +2527,10 @@ done_syscall: env->active_tc.gpr[8], env->active_tc.gpr[9], env->active_tc.gpr[10], env->active_tc.gpr[11]); # endif /* O32 */ + if (ret == -TARGET_ERESTARTSYS) { + env->active_tc.PC -= 4; + break; + } if (ret == -TARGET_QEMU_ESIGRETURN) { /* Returning from a successful sigreturn syscall. Avoid clobbering register state. */ diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h index 6e1dc8b..460cc9f 100644 --- a/linux-user/mips/target_signal.h +++ b/linux-user/mips/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) return state->active_tc.gpr[29]; } + #endif /* TARGET_SIGNAL_H */ diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index 5fb6a2c..a2dc514 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) return state->active_tc.gpr[29]; } + #endif /* TARGET_SIGNAL_H */ -- 1.9.1