/[qemu]/qemu/target-ppc/translate.c
ViewVC logotype

Diff of /qemu/target-ppc/translate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by bellard, Mon Nov 21 23:32:10 2005 UTC revision 1.39 by bellard, Wed Nov 23 21:36:30 2005 UTC
# Line 177  RET_EXCP((ctx), EXCP_PROGRAM, EXCP_INVAL Line 177  RET_EXCP((ctx), EXCP_PROGRAM, EXCP_INVAL
177  #define RET_PRIVREG(ctx)                                                      \  #define RET_PRIVREG(ctx)                                                      \
178  RET_EXCP((ctx), EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG)  RET_EXCP((ctx), EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG)
179    
180  #define RET_MTMSR(ctx)                                                        \  /* Stop translation */
 RET_EXCP((ctx), EXCP_MTMSR, 0)  
   
181  static inline void RET_STOP (DisasContext *ctx)  static inline void RET_STOP (DisasContext *ctx)
182  {  {
183      RET_EXCP(ctx, EXCP_MTMSR, 0);      gen_op_update_nip((ctx)->nip);
184        ctx->exception = EXCP_MTMSR;
185  }  }
186    
187    /* No need to update nip here, as execution flow will change */
188  static inline void RET_CHG_FLOW (DisasContext *ctx)  static inline void RET_CHG_FLOW (DisasContext *ctx)
189  {  {
     gen_op_raise_exception_err(EXCP_MTMSR, 0);  
190      ctx->exception = EXCP_MTMSR;      ctx->exception = EXCP_MTMSR;
191  }  }
192    
# Line 2051  static inline void gen_op_mfspr (DisasCo Line 2050  static inline void gen_op_mfspr (DisasCo
2050              gen_op_store_T0_gpr(rD(ctx->opcode));              gen_op_store_T0_gpr(rD(ctx->opcode));
2051          } else {          } else {
2052              /* Privilege exception */              /* Privilege exception */
2053                if (loglevel) {
2054                    fprintf(logfile, "Trying to read priviledged spr %d %03x\n",
2055                            sprn, sprn);
2056                }
2057              printf("Trying to read priviledged spr %d %03x\n", sprn, sprn);              printf("Trying to read priviledged spr %d %03x\n", sprn, sprn);
2058          RET_PRIVREG(ctx);          RET_PRIVREG(ctx);
2059          }          }
2060      } else {      } else {
2061          /* Not defined */          /* Not defined */
2062            if (loglevel) {
2063                fprintf(logfile, "Trying to read invalid spr %d %03x\n",
2064                        sprn, sprn);
2065            }
2066          printf("Trying to read invalid spr %d %03x\n", sprn, sprn);          printf("Trying to read invalid spr %d %03x\n", sprn, sprn);
2067          RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);          RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);
2068      }      }
# Line 2093  GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x0 Line 2100  GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x0
2100      gen_op_load_gpr_T0(rS(ctx->opcode));      gen_op_load_gpr_T0(rS(ctx->opcode));
2101      gen_op_store_msr();      gen_op_store_msr();
2102      /* Must stop the translation as machine state (may have) changed */      /* Must stop the translation as machine state (may have) changed */
2103      RET_MTMSR(ctx);      RET_STOP(ctx);
2104  #endif  #endif
2105  }  }
2106    
# Line 2115  GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x0 Line 2122  GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x0
2122              (*write_cb)(ctx, sprn);              (*write_cb)(ctx, sprn);
2123          } else {          } else {
2124              /* Privilege exception */              /* Privilege exception */
2125                if (loglevel) {
2126                    fprintf(logfile, "Trying to write priviledged spr %d %03x\n",
2127                            sprn, sprn);
2128                }
2129              printf("Trying to write priviledged spr %d %03x\n", sprn, sprn);              printf("Trying to write priviledged spr %d %03x\n", sprn, sprn);
2130          RET_PRIVREG(ctx);          RET_PRIVREG(ctx);
2131      }      }
2132      } else {      } else {
2133          /* Not defined */          /* Not defined */
2134            if (loglevel) {
2135                fprintf(logfile, "Trying to write invalid spr %d %03x\n",
2136                        sprn, sprn);
2137            }
2138          printf("Trying to write invalid spr %d %03x\n", sprn, sprn);          printf("Trying to write invalid spr %d %03x\n", sprn, sprn);
2139          RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);          RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);
2140      }      }
# Line 2278  GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x00 Line 2293  GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x00
2293      }      }
2294      gen_op_load_gpr_T0(rS(ctx->opcode));      gen_op_load_gpr_T0(rS(ctx->opcode));
2295      gen_op_store_sr(SR(ctx->opcode));      gen_op_store_sr(SR(ctx->opcode));
2296      RET_MTMSR(ctx);      RET_STOP(ctx);
2297  #endif  #endif
2298  }  }
2299    
# Line 2295  GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x Line 2310  GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x
2310      gen_op_load_gpr_T0(rS(ctx->opcode));      gen_op_load_gpr_T0(rS(ctx->opcode));
2311      gen_op_load_gpr_T1(rB(ctx->opcode));      gen_op_load_gpr_T1(rB(ctx->opcode));
2312      gen_op_store_srin();      gen_op_store_srin();
2313      RET_MTMSR(ctx);      RET_STOP(ctx);
2314  #endif  #endif
2315  }  }
2316    
# Line 2314  GEN_HANDLER(tlbia, 0x1F, 0x12, 0x0B, 0x0 Line 2329  GEN_HANDLER(tlbia, 0x1F, 0x12, 0x0B, 0x0
2329          return;          return;
2330      }      }
2331      gen_op_tlbia();      gen_op_tlbia();
2332      RET_MTMSR(ctx);      RET_STOP(ctx);
2333  #endif  #endif
2334  }  }
2335    
# Line 2330  GEN_HANDLER(tlbie, 0x1F, 0x12, 0x09, 0x0 Line 2345  GEN_HANDLER(tlbie, 0x1F, 0x12, 0x09, 0x0
2345      }      }
2346      gen_op_load_gpr_T0(rB(ctx->opcode));      gen_op_load_gpr_T0(rB(ctx->opcode));
2347      gen_op_tlbie();      gen_op_tlbie();
2348      RET_MTMSR(ctx);      RET_STOP(ctx);
2349  #endif  #endif
2350  }  }
2351    
# Line 2347  GEN_HANDLER(tlbsync, 0x1F, 0x16, 0x11, 0 Line 2362  GEN_HANDLER(tlbsync, 0x1F, 0x16, 0x11, 0
2362      /* This has no effect: it should ensure that all previous      /* This has no effect: it should ensure that all previous
2363       * tlbie have completed       * tlbie have completed
2364       */       */
2365      RET_MTMSR(ctx);      RET_STOP(ctx);
2366  #endif  #endif
2367  }  }
2368    

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26