Commit 867abc7e50500178423799f28179efef73f3f1b3

Authored by aurel32
1 parent 30a3848b

target-mips: fix commits 7040 and 7042

CPU state should also be saved for helpers that in fine call
cpu_unlink_tb(). Reported by Stefan Weil.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7096 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 2 deletions
target-mips/translate.c
... ... @@ -3697,6 +3697,7 @@ static void gen_mtc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int se
3697 3697 case 12:
3698 3698 switch (sel) {
3699 3699 case 0:
  3700 + save_cpu_state(ctx, 1);
3700 3701 gen_helper_mtc0_status(t0);
3701 3702 /* BS_STOP isn't good enough here, hflags may have changed. */
3702 3703 gen_save_pc(ctx->pc + 4);
... ... @@ -3731,6 +3732,7 @@ static void gen_mtc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int se
3731 3732 case 13:
3732 3733 switch (sel) {
3733 3734 case 0:
  3735 + save_cpu_state(ctx, 1);
3734 3736 gen_helper_mtc0_cause(t0);
3735 3737 rn = "Cause";
3736 3738 break;
... ... @@ -4861,6 +4863,7 @@ static void gen_dmtc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int s
4861 4863 case 12:
4862 4864 switch (sel) {
4863 4865 case 0:
  4866 + save_cpu_state(ctx, 1);
4864 4867 gen_helper_mtc0_status(t0);
4865 4868 /* BS_STOP isn't good enough here, hflags may have changed. */
4866 4869 gen_save_pc(ctx->pc + 4);
... ... @@ -4895,14 +4898,13 @@ static void gen_dmtc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int s
4895 4898 case 13:
4896 4899 switch (sel) {
4897 4900 case 0:
  4901 + save_cpu_state(ctx, 1);
4898 4902 gen_helper_mtc0_cause(t0);
4899 4903 rn = "Cause";
4900 4904 break;
4901 4905 default:
4902 4906 goto die;
4903 4907 }
4904   - /* Stop translation as we may have switched the execution mode */
4905   - ctx->bstate = BS_STOP;
4906 4908 break;
4907 4909 case 14:
4908 4910 switch (sel) {
... ... @@ -7972,6 +7974,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
7972 7974 break;
7973 7975 case OPC_DI:
7974 7976 check_insn(env, ctx, ISA_MIPS32R2);
  7977 + save_cpu_state(ctx, 1);
7975 7978 gen_helper_di(t0);
7976 7979 gen_store_gpr(t0, rt);
7977 7980 /* Stop translation as we may have switched the execution mode */
... ... @@ -7979,6 +7982,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
7979 7982 break;
7980 7983 case OPC_EI:
7981 7984 check_insn(env, ctx, ISA_MIPS32R2);
  7985 + save_cpu_state(ctx, 1);
7982 7986 gen_helper_ei(t0);
7983 7987 gen_store_gpr(t0, rt);
7984 7988 /* Stop translation as we may have switched the execution mode */
... ...