diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-01 05:22:17 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-01 05:22:17 +0000 |
commit | 30032c940a625f0aa8f04becf78e47274ec3a319 (patch) | |
tree | eb5a7d892161631882bc04c4fa9edc7b9acf7c6e /target-ppc | |
parent | 7dbe11acd807b7a1566b2fe665333a49f8358de0 (diff) |
Fix missing nip updates for instructions that potentially generate
exceptions from op helpers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3308 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/translate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index d8f6e95c9e..3cb89f4979 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -2634,6 +2634,8 @@ static GenOpFunc *gen_op_stwcx[] = { /* lwarx */ GEN_HANDLER(lwarx, 0x1F, 0x14, 0x00, 0x00000001, PPC_RES) { + /* NIP cannot be restored if the memory exception comes from an helper */ + gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); op_lwarx(); gen_op_store_T1_gpr(rD(ctx->opcode)); @@ -2642,6 +2644,8 @@ GEN_HANDLER(lwarx, 0x1F, 0x14, 0x00, 0x00000001, PPC_RES) /* stwcx. */ GEN_HANDLER(stwcx_, 0x1F, 0x16, 0x04, 0x00000000, PPC_RES) { + /* NIP cannot be restored if the memory exception comes from an helper */ + gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); gen_op_load_gpr_T1(rS(ctx->opcode)); op_stwcx(); @@ -2689,6 +2693,8 @@ static GenOpFunc *gen_op_stdcx[] = { /* ldarx */ GEN_HANDLER(ldarx, 0x1F, 0x14, 0x02, 0x00000001, PPC_64B) { + /* NIP cannot be restored if the memory exception comes from an helper */ + gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); op_ldarx(); gen_op_store_T1_gpr(rD(ctx->opcode)); @@ -2697,6 +2703,8 @@ GEN_HANDLER(ldarx, 0x1F, 0x14, 0x02, 0x00000001, PPC_64B) /* stdcx. */ GEN_HANDLER(stdcx_, 0x1F, 0x16, 0x06, 0x00000000, PPC_64B) { + /* NIP cannot be restored if the memory exception comes from an helper */ + gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); gen_op_load_gpr_T1(rS(ctx->opcode)); op_stdcx(); @@ -3612,6 +3620,8 @@ static GenOpFunc *gen_op_icbi[] = { GEN_HANDLER(icbi, 0x1F, 0x16, 0x1E, 0x03E00001, PPC_CACHE) { + /* NIP cannot be restored if the memory exception comes from an helper */ + gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); op_icbi(); } |