[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/38] linux-user: Support for restarting system call
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 13/38] linux-user: Support for restarting system calls for UniCore32 targets |
Date: |
Wed, 25 May 2016 13:31:45 +0300 |
From: Timothy E Baldwin <address@hidden>
Update the UniCore32 main loop code:
* on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn
* handle TARGET_QEMU_ESIGRETURN in the main loop as the indication
that the main loop should not touch any guest CPU state
(We don't support signals on this target so there is no sigreturn code
to update.)
Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
[PMM: tweak commit message; drop TARGET_USE_ERESTARTSYS define]
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index eeea8f5..2d7e700 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1171,7 +1171,7 @@ void cpu_loop(CPUUniCore32State *env)
cpu_set_tls(env, env->regs[0]);
env->regs[0] = 0;
} else {
- env->regs[0] = do_syscall(env,
+ abi_long ret = do_syscall(env,
n,
env->regs[0],
env->regs[1],
@@ -1180,6 +1180,11 @@ void cpu_loop(CPUUniCore32State *env)
env->regs[4],
env->regs[5],
0, 0);
+ if (ret == -TARGET_ERESTARTSYS) {
+ env->regs[31] -= 4;
+ } else if (ret != -TARGET_QEMU_ESIGRETURN) {
+ env->regs[0] = ret;
+ }
}
} else {
goto error;
--
2.1.4
- [Qemu-devel] [PULL 02/38] linux-user: Consistently return host errnos from do_openat(), (continued)
- [Qemu-devel] [PULL 02/38] linux-user: Consistently return host errnos from do_openat(), riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 01/38] linux-user: Check array bounds in errno conversion, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 04/38] linux-user: Define TARGET_ERESTART* errno values, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 06/38] linux-user: Support for restarting system calls for x86 targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 05/38] linux-user: Renumber TARGET_QEMU_ESIGRETURN, make it not arch-specific, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 07/38] linux-user: Support for restarting system calls for ARM targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 03/38] linux-user: Reindent signal handling, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 08/38] linux-user: Support for restarting system calls for MIPS targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 10/38] linux-user: Support for restarting system calls for SPARC targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 11/38] linux-user: Support for restarting system calls for SH4 targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 13/38] linux-user: Support for restarting system calls for UniCore32 targets,
riku . voipio <=
- [Qemu-devel] [PULL 12/38] linux-user: Support for restarting system calls for Alpha targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 14/38] linux-user: Support for restarting system calls for OpenRISC targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 17/38] linux-user: Support for restarting system calls for CRIS targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 09/38] linux-user: Support for restarting system calls for PPC targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 15/38] linux-user: Support for restarting system calls for M68K targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 20/38] linux-user: Support for restarting system calls for Microblaze targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 19/38] linux-user: Set r14 on exit from microblaze syscall, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 16/38] linux-user: Support for restarting system calls for S390 targets, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 21/38] linux-user: Add debug code to exercise restarting system calls, riku . voipio, 2016/05/25
- [Qemu-devel] [PULL 18/38] linux-user: Support for restarting system calls for tilegx targets, riku . voipio, 2016/05/25