diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2010-02-28 14:11:06 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-02-28 14:11:06 +0100 |
commit | edc5b796c6547cebb89264cc6282ff2fa15b1de4 (patch) | |
tree | cd10813dd2cdb5aaf5b48168c8f95a3a2dba003c | |
parent | 3f72600aef3d6b6348062038f197bfdc755f10ec (diff) | |
download | qemu-edc5b796c6547cebb89264cc6282ff2fa15b1de4.tar.gz qemu-edc5b796c6547cebb89264cc6282ff2fa15b1de4.tar.bz2 qemu-edc5b796c6547cebb89264cc6282ff2fa15b1de4.zip |
target-ppc: stop translation after a trap instruction
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | target-ppc/translate.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 0b11fda880..9da42404eb 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3618,8 +3618,9 @@ static void gen_sc(DisasContext *ctx) static void gen_tw(DisasContext *ctx) { TCGv_i32 t0 = tcg_const_i32(TO(ctx->opcode)); - /* Update the nip since this might generate a trap exception */ - gen_update_nip(ctx, ctx->nip); + /* Stop the translation since this might generate a trap exception + and/or following instructions might be invalid */ + gen_stop_exception(ctx); gen_helper_tw(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); tcg_temp_free_i32(t0); } @@ -3629,8 +3630,9 @@ static void gen_twi(DisasContext *ctx) { TCGv t0 = tcg_const_tl(SIMM(ctx->opcode)); TCGv_i32 t1 = tcg_const_i32(TO(ctx->opcode)); - /* Update the nip since this might generate a trap exception */ - gen_update_nip(ctx, ctx->nip); + /* Stop the translation since this might generate a trap exception + and/or following instructions might be invalid */ + gen_stop_exception(ctx); gen_helper_tw(cpu_gpr[rA(ctx->opcode)], t0, t1); tcg_temp_free(t0); tcg_temp_free_i32(t1); @@ -3641,8 +3643,9 @@ static void gen_twi(DisasContext *ctx) static void gen_td(DisasContext *ctx) { TCGv_i32 t0 = tcg_const_i32(TO(ctx->opcode)); - /* Update the nip since this might generate a trap exception */ - gen_update_nip(ctx, ctx->nip); + /* Stop the translation since this might generate a trap exception + and/or following instructions might be invalid */ + gen_stop_exception(ctx); gen_helper_td(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); tcg_temp_free_i32(t0); } @@ -3652,8 +3655,9 @@ static void gen_tdi(DisasContext *ctx) { TCGv t0 = tcg_const_tl(SIMM(ctx->opcode)); TCGv_i32 t1 = tcg_const_i32(TO(ctx->opcode)); - /* Update the nip since this might generate a trap exception */ - gen_update_nip(ctx, ctx->nip); + /* Stop the translation since this might generate a trap exception + and/or following instructions might be invalid */ + gen_stop_exception(ctx); gen_helper_td(cpu_gpr[rA(ctx->opcode)], t0, t1); tcg_temp_free(t0); tcg_temp_free_i32(t1); |