linux-user: Support for restarting system calls for MIPS targets

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 <T.E.Baldwin99@members.leeds.ac.uk>
Message-id: 1441497448-32489-7-git-send-email-T.E.Baldwin99@members.leeds.ac.uk
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: tweak commit message; drop TARGET_USE_ERESTARTSYS define]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
Timothy E Baldwin 2016-05-12 18:47:32 +01:00 committed by Riku Voipio
parent f0267ef711
commit 2eb3ae27ec
3 changed files with 6 additions and 0 deletions

View File

@ -2528,6 +2528,10 @@ done_syscall:
env->active_tc.gpr[8], env->active_tc.gpr[9], env->active_tc.gpr[8], env->active_tc.gpr[9],
env->active_tc.gpr[10], env->active_tc.gpr[11]); env->active_tc.gpr[10], env->active_tc.gpr[11]);
# endif /* O32 */ # endif /* O32 */
if (ret == -TARGET_ERESTARTSYS) {
env->active_tc.PC -= 4;
break;
}
if (ret == -TARGET_QEMU_ESIGRETURN) { if (ret == -TARGET_QEMU_ESIGRETURN) {
/* Returning from a successful sigreturn syscall. /* Returning from a successful sigreturn syscall.
Avoid clobbering register state. */ Avoid clobbering register state. */

View File

@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
return state->active_tc.gpr[29]; return state->active_tc.gpr[29];
} }
#endif /* TARGET_SIGNAL_H */ #endif /* TARGET_SIGNAL_H */

View File

@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
return state->active_tc.gpr[29]; return state->active_tc.gpr[29];
} }
#endif /* TARGET_SIGNAL_H */ #endif /* TARGET_SIGNAL_H */