Revision 41c1b1c9 exec-all.h
b/exec-all.h | ||
---|---|---|
25 | 25 |
/* allow to see translation results - the slowdown should be negligible, so we leave it */ |
26 | 26 |
#define DEBUG_DISAS |
27 | 27 |
|
28 |
/* Page tracking code uses ram addresses in system mode, and virtual |
|
29 |
addresses in userspace mode. Define tb_page_addr_t to be an appropriate |
|
30 |
type. */ |
|
31 |
#if defined(CONFIG_USER_ONLY) |
|
32 |
typedef target_ulong tb_page_addr_t; |
|
33 |
#else |
|
34 |
typedef ram_addr_t tb_page_addr_t; |
|
35 |
#endif |
|
36 |
|
|
28 | 37 |
/* is_jmp field values */ |
29 | 38 |
#define DISAS_NEXT 0 /* next instruction can be analyzed */ |
30 | 39 |
#define DISAS_JUMP 1 /* only pc was modified dynamically */ |
... | ... | |
81 | 90 |
void cpu_exec_init(CPUState *env); |
82 | 91 |
void QEMU_NORETURN cpu_loop_exit(void); |
83 | 92 |
int page_unprotect(target_ulong address, unsigned long pc, void *puc); |
84 |
void tb_invalidate_phys_page_range(target_phys_addr_t start, target_phys_addr_t end,
|
|
93 |
void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
|
|
85 | 94 |
int is_cpu_write_access); |
86 | 95 |
void tb_invalidate_page_range(target_ulong start, target_ulong end); |
87 | 96 |
void tlb_flush_page(CPUState *env, target_ulong addr); |
... | ... | |
136 | 145 |
/* first and second physical page containing code. The lower bit |
137 | 146 |
of the pointer tells the index in page_next[] */ |
138 | 147 |
struct TranslationBlock *page_next[2]; |
139 |
target_ulong page_addr[2];
|
|
148 |
tb_page_addr_t page_addr[2];
|
|
140 | 149 |
|
141 | 150 |
/* the following data are used to directly call another TB from |
142 | 151 |
the code of this one. */ |
... | ... | |
170 | 179 |
| (tmp & TB_JMP_ADDR_MASK)); |
171 | 180 |
} |
172 | 181 |
|
173 |
static inline unsigned int tb_phys_hash_func(unsigned long pc)
|
|
182 |
static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc)
|
|
174 | 183 |
{ |
175 | 184 |
return pc & (CODE_GEN_PHYS_HASH_SIZE - 1); |
176 | 185 |
} |
... | ... | |
178 | 187 |
TranslationBlock *tb_alloc(target_ulong pc); |
179 | 188 |
void tb_free(TranslationBlock *tb); |
180 | 189 |
void tb_flush(CPUState *env); |
181 |
void tb_link_phys(TranslationBlock *tb,
|
|
182 |
target_ulong phys_pc, target_ulong phys_page2);
|
|
183 |
void tb_phys_invalidate(TranslationBlock *tb, target_ulong page_addr);
|
|
190 |
void tb_link_page(TranslationBlock *tb,
|
|
191 |
tb_page_addr_t phys_pc, tb_page_addr_t phys_page2);
|
|
192 |
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
|
|
184 | 193 |
|
185 | 194 |
extern TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE]; |
186 | 195 |
extern uint8_t *code_gen_ptr; |
... | ... | |
305 | 314 |
#endif |
306 | 315 |
|
307 | 316 |
#if defined(CONFIG_USER_ONLY) |
308 |
static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr)
|
|
317 |
static inline tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong addr)
|
|
309 | 318 |
{ |
310 | 319 |
return addr; |
311 | 320 |
} |
... | ... | |
313 | 322 |
/* NOTE: this function can trigger an exception */ |
314 | 323 |
/* NOTE2: the returned address is not exactly the physical address: it |
315 | 324 |
is the offset relative to phys_ram_base */ |
316 |
static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr)
|
|
325 |
static inline tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong addr)
|
|
317 | 326 |
{ |
318 | 327 |
int mmu_idx, page_index, pd; |
319 | 328 |
void *p; |
Also available in: Unified diff