summaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorTimothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>2016-05-12 18:47:35 +0100
committerRiku Voipio <riku.voipio@linaro.org>2016-05-27 14:49:49 +0300
commitba41249678f8c1504bf07706ddb0eda0d36cccc2 (patch)
tree2257fb4ec35b6043c04c067d4be3f5c01310f66e /linux-user/main.c
parentc0bea68f9ea48f0dea7a06a259a613bfd3a7e35e (diff)
downloadqemu-ba41249678f8c1504bf07706ddb0eda0d36cccc2.zip
linux-user: Support for restarting system calls for SH4 targets
Update the SH4 main loop and sigreturn code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn * set all guest CPU state within signal.c code on sigreturn * handle TARGET_QEMU_ESIGRETURN in the main loop as the indication that the main loop should not touch any guest CPU state Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Message-id: 1441497448-32489-12-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>
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 04a9b9b4c1..75552a050c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2826,7 +2826,11 @@ void cpu_loop(CPUSH4State *env)
env->gregs[0],
env->gregs[1],
0, 0);
- env->gregs[0] = ret;
+ if (ret == -TARGET_ERESTARTSYS) {
+ env->pc -= 2;
+ } else if (ret != -TARGET_QEMU_ESIGRETURN) {
+ env->gregs[0] = ret;
+ }
break;
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */