Make sure hflags are updated for CP0_Status changes.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2918 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-06-01 17:47:07 +00:00
parent 5b9693dcda
commit 8487327a1d

View File

@ -2627,25 +2627,32 @@ static void gen_mtc0 (DisasContext *ctx, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
gen_op_mtc0_status(); gen_op_mtc0_status();
/* BS_STOP isn't good enough here, hflags may have changed. */
gen_save_pc(ctx->pc + 4);
ctx->bstate = BS_EXCP;
rn = "Status"; rn = "Status";
break; break;
case 1: case 1:
gen_op_mtc0_intctl(); gen_op_mtc0_intctl();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "IntCtl"; rn = "IntCtl";
break; break;
case 2: case 2:
gen_op_mtc0_srsctl(); gen_op_mtc0_srsctl();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "SRSCtl"; rn = "SRSCtl";
break; break;
case 3: case 3:
gen_op_mtc0_srsmap(); gen_op_mtc0_srsmap();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "SRSMap"; rn = "SRSMap";
break; break;
default: default:
goto die; goto die;
} }
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
break; break;
case 13: case 13:
switch (sel) { switch (sel) {
@ -2781,29 +2788,40 @@ static void gen_mtc0 (DisasContext *ctx, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
gen_op_mtc0_debug(); /* EJTAG support */ gen_op_mtc0_debug(); /* EJTAG support */
/* BS_STOP isn't good enough here, hflags may have changed. */
gen_save_pc(ctx->pc + 4);
ctx->bstate = BS_EXCP;
rn = "Debug"; rn = "Debug";
break; break;
case 1: case 1:
// gen_op_mtc0_tracecontrol(); /* PDtrace support */ // gen_op_mtc0_tracecontrol(); /* PDtrace support */
rn = "TraceControl"; rn = "TraceControl";
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
// break; // break;
case 2: case 2:
// gen_op_mtc0_tracecontrol2(); /* PDtrace support */ // gen_op_mtc0_tracecontrol2(); /* PDtrace support */
rn = "TraceControl2"; rn = "TraceControl2";
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
// break; // break;
case 3: case 3:
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
// gen_op_mtc0_usertracedata(); /* PDtrace support */ // gen_op_mtc0_usertracedata(); /* PDtrace support */
rn = "UserTraceData"; rn = "UserTraceData";
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
// break; // break;
case 4: case 4:
// gen_op_mtc0_debug(); /* PDtrace support */ // gen_op_mtc0_debug(); /* PDtrace support */
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "TraceBPC"; rn = "TraceBPC";
// break; // break;
default: default:
goto die; goto die;
} }
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
break; break;
case 24: case 24:
switch (sel) { switch (sel) {
@ -3704,25 +3722,32 @@ static void gen_dmtc0 (DisasContext *ctx, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
gen_op_mtc0_status(); gen_op_mtc0_status();
/* BS_STOP isn't good enough here, hflags may have changed. */
gen_save_pc(ctx->pc + 4);
ctx->bstate = BS_EXCP;
rn = "Status"; rn = "Status";
break; break;
case 1: case 1:
gen_op_mtc0_intctl(); gen_op_mtc0_intctl();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "IntCtl"; rn = "IntCtl";
break; break;
case 2: case 2:
gen_op_mtc0_srsctl(); gen_op_mtc0_srsctl();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "SRSCtl"; rn = "SRSCtl";
break; break;
case 3: case 3:
gen_op_mtc0_srsmap(); gen_op_mtc0_srsmap();
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "SRSMap"; rn = "SRSMap";
break; break;
default: default:
goto die; goto die;
} }
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
break; break;
case 13: case 13:
switch (sel) { switch (sel) {
@ -3849,29 +3874,38 @@ static void gen_dmtc0 (DisasContext *ctx, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
gen_op_mtc0_debug(); /* EJTAG support */ gen_op_mtc0_debug(); /* EJTAG support */
/* BS_STOP isn't good enough here, hflags may have changed. */
gen_save_pc(ctx->pc + 4);
ctx->bstate = BS_EXCP;
rn = "Debug"; rn = "Debug";
break; break;
case 1: case 1:
// gen_op_mtc0_tracecontrol(); /* PDtrace support */ // gen_op_mtc0_tracecontrol(); /* PDtrace support */
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "TraceControl"; rn = "TraceControl";
// break; // break;
case 2: case 2:
// gen_op_mtc0_tracecontrol2(); /* PDtrace support */ // gen_op_mtc0_tracecontrol2(); /* PDtrace support */
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "TraceControl2"; rn = "TraceControl2";
// break; // break;
case 3: case 3:
// gen_op_mtc0_usertracedata(); /* PDtrace support */ // gen_op_mtc0_usertracedata(); /* PDtrace support */
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "UserTraceData"; rn = "UserTraceData";
// break; // break;
case 4: case 4:
// gen_op_mtc0_debug(); /* PDtrace support */ // gen_op_mtc0_debug(); /* PDtrace support */
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
rn = "TraceBPC"; rn = "TraceBPC";
// break; // break;
default: default:
goto die; goto die;
} }
/* Stop translation as we may have switched the execution mode */
ctx->bstate = BS_STOP;
break; break;
case 24: case 24:
switch (sel) { switch (sel) {