]> git.proxmox.com Git - mirror_qemu.git/commitdiff
microblaze: Update PC before simulating syscall
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>
Thu, 26 Apr 2012 12:18:25 +0000 (14:18 +0200)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Fri, 19 Oct 2012 11:24:12 +0000 (13:24 +0200)
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>
linux-user/main.c

index f4bbe697f78862d565751cbae22cd7bdbc7b2ddb..5827ee6a27e89386d946afcd8e54c8bde4d41e15 100644 (file)
@@ -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;