1463 |
s->is_jmp = 1; |
s->is_jmp = 1; |
1464 |
} |
} |
1465 |
|
|
1466 |
|
static void gen_debug(DisasContext *s, unsigned int cur_eip) |
1467 |
|
{ |
1468 |
|
if (s->cc_op != CC_OP_DYNAMIC) |
1469 |
|
gen_op_set_cc_op(s->cc_op); |
1470 |
|
gen_op_jmp_im(cur_eip); |
1471 |
|
gen_op_debug(); |
1472 |
|
s->is_jmp = 1; |
1473 |
|
} |
1474 |
|
|
1475 |
/* generate a jump to eip. No segment change must happen before as a |
/* generate a jump to eip. No segment change must happen before as a |
1476 |
direct call to the next block may occur */ |
direct call to the next block may occur */ |
1477 |
static void gen_jmp(DisasContext *s, unsigned int eip) |
static void gen_jmp(DisasContext *s, unsigned int eip) |
4089 |
/* generate intermediate code in gen_opc_buf and gen_opparam_buf for |
/* generate intermediate code in gen_opc_buf and gen_opparam_buf for |
4090 |
basic block 'tb'. If search_pc is TRUE, also generate PC |
basic block 'tb'. If search_pc is TRUE, also generate PC |
4091 |
information for each intermediate instruction. */ |
information for each intermediate instruction. */ |
4092 |
static inline int gen_intermediate_code_internal(TranslationBlock *tb, int search_pc) |
static inline int gen_intermediate_code_internal(CPUState *env, |
4093 |
|
TranslationBlock *tb, |
4094 |
|
int search_pc) |
4095 |
{ |
{ |
4096 |
DisasContext dc1, *dc = &dc1; |
DisasContext dc1, *dc = &dc1; |
4097 |
uint8_t *pc_ptr; |
uint8_t *pc_ptr; |
4127 |
pc_ptr = pc_start; |
pc_ptr = pc_start; |
4128 |
lj = -1; |
lj = -1; |
4129 |
do { |
do { |
4130 |
|
if (env->nb_breakpoints > 0) { |
4131 |
|
for(j = 0; j < env->nb_breakpoints; j++) { |
4132 |
|
if (env->breakpoints[j] == (unsigned long)pc_ptr) { |
4133 |
|
gen_debug(dc, pc_ptr - dc->cs_base); |
4134 |
|
goto the_end; |
4135 |
|
} |
4136 |
|
} |
4137 |
|
} |
4138 |
if (search_pc) { |
if (search_pc) { |
4139 |
j = gen_opc_ptr - gen_opc_buf; |
j = gen_opc_ptr - gen_opc_buf; |
4140 |
if (lj < j) { |
if (lj < j) { |
4179 |
if (dc->tf) { |
if (dc->tf) { |
4180 |
gen_op_raise_exception(EXCP01_SSTP); |
gen_op_raise_exception(EXCP01_SSTP); |
4181 |
} |
} |
4182 |
|
the_end: |
4183 |
if (dc->is_jmp != DISAS_TB_JUMP) { |
if (dc->is_jmp != DISAS_TB_JUMP) { |
4184 |
/* indicate that the hash table must be used to find the next TB */ |
/* indicate that the hash table must be used to find the next TB */ |
4185 |
gen_op_movl_T0_0(); |
gen_op_movl_T0_0(); |
4222 |
return 0; |
return 0; |
4223 |
} |
} |
4224 |
|
|
4225 |
int gen_intermediate_code(TranslationBlock *tb) |
int gen_intermediate_code(CPUState *env, TranslationBlock *tb) |
4226 |
{ |
{ |
4227 |
return gen_intermediate_code_internal(tb, 0); |
return gen_intermediate_code_internal(env, tb, 0); |
4228 |
} |
} |
4229 |
|
|
4230 |
int gen_intermediate_code_pc(TranslationBlock *tb) |
int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb) |
4231 |
{ |
{ |
4232 |
return gen_intermediate_code_internal(tb, 1); |
return gen_intermediate_code_internal(env, tb, 1); |
4233 |
} |
} |
4234 |
|
|
4235 |
CPUX86State *cpu_x86_init(void) |
CPUX86State *cpu_x86_init(void) |