diff options
-rw-r--r-- | target-m68k/translate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target-m68k/translate.c b/target-m68k/translate.c index ad8faadc0c..9fa46029a7 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -51,6 +51,7 @@ typedef struct DisasContext { uint32_t fpcr; struct TranslationBlock *tb; int singlestep_enabled; + int is_mem; } DisasContext; #define DISAS_JUMP_NEXT 4 @@ -129,6 +130,7 @@ typedef void (*disas_proc)(DisasContext *, uint16_t); static inline int gen_load(DisasContext * s, int opsize, int addr, int sign) { int tmp; + s->is_mem = 1; switch(opsize) { case OS_BYTE: tmp = gen_new_qreg(QMODE_I32); @@ -166,6 +168,7 @@ static inline int gen_load(DisasContext * s, int opsize, int addr, int sign) /* Generate a store. */ static inline void gen_store(DisasContext *s, int opsize, int addr, int val) { + s->is_mem = 1; switch(opsize) { case OS_BYTE: gen_st(s, 8, addr, val); @@ -2205,6 +2208,7 @@ DISAS_INSN(fpu) dest = QREG_F0; while (mask) { if (ext & mask) { + s->is_mem = 1; if (ext & (1 << 13)) { /* store */ gen_st(s, f64, addr, dest); @@ -3169,6 +3173,7 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, dc->singlestep_enabled = env->singlestep_enabled; dc->fpcr = env->fpcr; dc->user = (env->sr & SR_S) == 0; + dc->is_mem = 0; nb_gen_labels = 0; lj = -1; do { @@ -3199,6 +3204,12 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, last_cc_op = dc->cc_op; dc->insn_pc = dc->pc; disas_m68k_insn(env, dc); + + /* Terminate the TB on memory ops if watchpoints are present. */ + /* FIXME: This should be replacd by the deterministic execution + * IRQ raising bits. */ + if (dc->is_mem && env->nb_watchpoints) + break; } while (!dc->is_jmp && gen_opc_ptr < gen_opc_end && !env->singlestep_enabled && (pc_offset) < (TARGET_PAGE_SIZE - 32)); |