#include "exec.h"
#include "disas.h"
+int tb_invalidated_flag;
+
//#define DEBUG_EXEC
//#define DEBUG_SIGNAL
tb->tc_ptr = tc_ptr;
tb->cs_base = (unsigned long)cs_base;
tb->flags = flags;
- /* XXX: an MMU exception can occur here */
+ tb_invalidated_flag = 0;
cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size);
+ if (tb_invalidated_flag) {
+ /* as some TB could have been invalidated because
+ of memory exceptions while generating the code, we
+ must recompute the hash index here */
+ ptb = &tb_hash[tb_hash_func((unsigned long)pc)];
+ while (*ptb != NULL)
+ ptb = &(*ptb)->hash_next;
+ T0 = 0;
+ }
*ptb = tb;
tb->hash_next = NULL;
tb_link(tb);
extern spinlock_t tb_lock;
+extern int tb_invalidated_flag;
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
unsigned int h, n1;
TranslationBlock *tb1, *tb2;
+ tb_invalidated_flag = 1;
+
/* remove the TB from the hash list */
h = tb_hash_func(tb->pc);
tb_remove(&tb_hash[h], tb,