| 21 |
#include "exec.h" |
#include "exec.h" |
| 22 |
#include "disas.h" |
#include "disas.h" |
| 23 |
|
|
| 24 |
|
int tb_invalidated_flag; |
| 25 |
|
|
| 26 |
//#define DEBUG_EXEC |
//#define DEBUG_EXEC |
| 27 |
//#define DEBUG_SIGNAL |
//#define DEBUG_SIGNAL |
| 28 |
|
|
| 275 |
tb->tc_ptr = tc_ptr; |
tb->tc_ptr = tc_ptr; |
| 276 |
tb->cs_base = (unsigned long)cs_base; |
tb->cs_base = (unsigned long)cs_base; |
| 277 |
tb->flags = flags; |
tb->flags = flags; |
| 278 |
/* XXX: an MMU exception can occur here */ |
tb_invalidated_flag = 0; |
| 279 |
cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); |
cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); |
| 280 |
|
if (tb_invalidated_flag) { |
| 281 |
|
/* as some TB could have been invalidated because |
| 282 |
|
of memory exceptions while generating the code, we |
| 283 |
|
must recompute the hash index here */ |
| 284 |
|
ptb = &tb_hash[tb_hash_func((unsigned long)pc)]; |
| 285 |
|
while (*ptb != NULL) |
| 286 |
|
ptb = &(*ptb)->hash_next; |
| 287 |
|
T0 = 0; |
| 288 |
|
} |
| 289 |
*ptb = tb; |
*ptb = tb; |
| 290 |
tb->hash_next = NULL; |
tb->hash_next = NULL; |
| 291 |
tb_link(tb); |
tb_link(tb); |