diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-06 00:18:15 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-06 00:18:15 +0000 |
commit | ead9360e2fbcaae10a8ca3d8bfed885422205dca (patch) | |
tree | bbec65c2f895319d4192f9662919f74f51556f9a /linux-user/main.c | |
parent | 606b41e7020db7634fe90d069d2c019770c74b45 (diff) |
Partial support for 34K multithreading, not functional yet.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3156 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r-- | linux-user/main.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 32fa43d476..edcb68b8d4 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1374,8 +1374,8 @@ void cpu_loop(CPUMIPSState *env) trapnr = cpu_mips_exec(env); switch(trapnr) { case EXCP_SYSCALL: - syscall_num = env->gpr[2] - 4000; - env->PC += 4; + syscall_num = env->gpr[2][env->current_tc] - 4000; + env->PC[env->current_tc] += 4; if (syscall_num >= sizeof(mips_syscall_args)) { ret = -ENOSYS; } else { @@ -1384,7 +1384,7 @@ void cpu_loop(CPUMIPSState *env) target_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0; nb_args = mips_syscall_args[syscall_num]; - sp_reg = env->gpr[29]; + sp_reg = env->gpr[29][env->current_tc]; switch (nb_args) { /* these arguments are taken from the stack */ case 8: arg8 = tgetl(sp_reg + 28); @@ -1394,18 +1394,20 @@ void cpu_loop(CPUMIPSState *env) default: break; } - ret = do_syscall(env, env->gpr[2], - env->gpr[4], env->gpr[5], - env->gpr[6], env->gpr[7], + ret = do_syscall(env, env->gpr[2][env->current_tc], + env->gpr[4][env->current_tc], + env->gpr[5][env->current_tc], + env->gpr[6][env->current_tc], + env->gpr[7][env->current_tc], arg5, arg6/*, arg7, arg8*/); } if ((unsigned int)ret >= (unsigned int)(-1133)) { - env->gpr[7] = 1; /* error flag */ + env->gpr[7][env->current_tc] = 1; /* error flag */ ret = -ret; } else { - env->gpr[7] = 0; /* error flag */ + env->gpr[7][env->current_tc] = 0; /* error flag */ } - env->gpr[2] = ret; + env->gpr[2][env->current_tc] = ret; break; case EXCP_TLBL: case EXCP_TLBS: @@ -2053,9 +2055,9 @@ int main(int argc, char **argv) cpu_mips_register(env, def); for(i = 0; i < 32; i++) { - env->gpr[i] = regs->regs[i]; + env->gpr[i][env->current_tc] = regs->regs[i]; } - env->PC = regs->cp0_epc; + env->PC[env->current_tc] = regs->cp0_epc; } #elif defined(TARGET_SH4) { |