summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-04-26 14:18:25 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-10-19 13:24:12 +0200
commitd7dce494769e47c9a1eec6f55578d3acdfab888b (patch)
tree300607cfb4cada8a9c1e8b3d1c3bba620e135dde /linux-user
parenta5b3bdcba8a105439ad3a44121526306c449e100 (diff)
microblaze: Update PC before simulating syscall
Fixes a clone() emulation bug were the new thread starts at the point of the syscall and thus clones in a loop. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index f4bbe697f..5827ee6a2 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2527,6 +2527,7 @@ void cpu_loop(CPUMBState *env)
case EXCP_BREAK:
/* Return address is 4 bytes after the call. */
env->regs[14] += 4;
+ env->sregs[SR_PC] = env->regs[14];
ret = do_syscall(env,
env->regs[12],
env->regs[5],
@@ -2537,7 +2538,6 @@ void cpu_loop(CPUMBState *env)
env->regs[10],
0, 0);
env->regs[3] = ret;
- env->sregs[SR_PC] = env->regs[14];
break;
case EXCP_HW_EXCP:
env->regs[17] = env->sregs[SR_PC] + 4;