M68K watchpoint hacks.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2969 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
pbrook 2007-06-09 21:30:14 +00:00
parent 06d92f40a1
commit c9bac22c7d

View File

@ -51,6 +51,7 @@ typedef struct DisasContext {
uint32_t fpcr; uint32_t fpcr;
struct TranslationBlock *tb; struct TranslationBlock *tb;
int singlestep_enabled; int singlestep_enabled;
int is_mem;
} DisasContext; } DisasContext;
#define DISAS_JUMP_NEXT 4 #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) static inline int gen_load(DisasContext * s, int opsize, int addr, int sign)
{ {
int tmp; int tmp;
s->is_mem = 1;
switch(opsize) { switch(opsize) {
case OS_BYTE: case OS_BYTE:
tmp = gen_new_qreg(QMODE_I32); 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. */ /* Generate a store. */
static inline void gen_store(DisasContext *s, int opsize, int addr, int val) static inline void gen_store(DisasContext *s, int opsize, int addr, int val)
{ {
s->is_mem = 1;
switch(opsize) { switch(opsize) {
case OS_BYTE: case OS_BYTE:
gen_st(s, 8, addr, val); gen_st(s, 8, addr, val);
@ -2205,6 +2208,7 @@ DISAS_INSN(fpu)
dest = QREG_F0; dest = QREG_F0;
while (mask) { while (mask) {
if (ext & mask) { if (ext & mask) {
s->is_mem = 1;
if (ext & (1 << 13)) { if (ext & (1 << 13)) {
/* store */ /* store */
gen_st(s, f64, addr, dest); 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->singlestep_enabled = env->singlestep_enabled;
dc->fpcr = env->fpcr; dc->fpcr = env->fpcr;
dc->user = (env->sr & SR_S) == 0; dc->user = (env->sr & SR_S) == 0;
dc->is_mem = 0;
nb_gen_labels = 0; nb_gen_labels = 0;
lj = -1; lj = -1;
do { do {
@ -3199,6 +3204,12 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
last_cc_op = dc->cc_op; last_cc_op = dc->cc_op;
dc->insn_pc = dc->pc; dc->insn_pc = dc->pc;
disas_m68k_insn(env, dc); 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 && } while (!dc->is_jmp && gen_opc_ptr < gen_opc_end &&
!env->singlestep_enabled && !env->singlestep_enabled &&
(pc_offset) < (TARGET_PAGE_SIZE - 32)); (pc_offset) < (TARGET_PAGE_SIZE - 32));