42 |
TranslationBlock tbs[CODE_GEN_MAX_BLOCKS]; |
TranslationBlock tbs[CODE_GEN_MAX_BLOCKS]; |
43 |
TranslationBlock *tb_hash[CODE_GEN_HASH_SIZE]; |
TranslationBlock *tb_hash[CODE_GEN_HASH_SIZE]; |
44 |
int nb_tbs; |
int nb_tbs; |
45 |
|
/* any access to the tbs or the page table must use this lock */ |
46 |
|
spinlock_t tb_lock = SPIN_LOCK_UNLOCKED; |
47 |
|
|
48 |
uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE]; |
uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE]; |
49 |
uint8_t *code_gen_ptr; |
uint8_t *code_gen_ptr; |
174 |
end = TARGET_PAGE_ALIGN(end); |
end = TARGET_PAGE_ALIGN(end); |
175 |
if (flags & PAGE_WRITE) |
if (flags & PAGE_WRITE) |
176 |
flags |= PAGE_WRITE_ORG; |
flags |= PAGE_WRITE_ORG; |
177 |
|
spin_lock(&tb_lock); |
178 |
for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) { |
for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) { |
179 |
p = page_find_alloc(addr >> TARGET_PAGE_BITS); |
p = page_find_alloc(addr >> TARGET_PAGE_BITS); |
180 |
/* if the write protection is set, then we invalidate the code |
/* if the write protection is set, then we invalidate the code |
186 |
} |
} |
187 |
p->flags = flags; |
p->flags = flags; |
188 |
} |
} |
189 |
|
spin_unlock(&tb_lock); |
190 |
} |
} |
191 |
|
|
192 |
void cpu_x86_tblocks_init(void) |
void cpu_x86_tblocks_init(void) |