mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
accel/tcg: Pass TCGTBCPUState to tb_htable_lookup
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
b46357db32
commit
088caf3de4
1 changed files with 9 additions and 11 deletions
|
@ -195,26 +195,24 @@ static bool tb_lookup_cmp(const void *p, const void *d)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TranslationBlock *tb_htable_lookup(CPUState *cpu, vaddr pc,
|
static TranslationBlock *tb_htable_lookup(CPUState *cpu, TCGTBCPUState s)
|
||||||
uint64_t cs_base, uint32_t flags,
|
|
||||||
uint32_t cflags)
|
|
||||||
{
|
{
|
||||||
tb_page_addr_t phys_pc;
|
tb_page_addr_t phys_pc;
|
||||||
struct tb_desc desc;
|
struct tb_desc desc;
|
||||||
uint32_t h;
|
uint32_t h;
|
||||||
|
|
||||||
desc.env = cpu_env(cpu);
|
desc.env = cpu_env(cpu);
|
||||||
desc.cs_base = cs_base;
|
desc.cs_base = s.cs_base;
|
||||||
desc.flags = flags;
|
desc.flags = s.flags;
|
||||||
desc.cflags = cflags;
|
desc.cflags = s.cflags;
|
||||||
desc.pc = pc;
|
desc.pc = s.pc;
|
||||||
phys_pc = get_page_addr_code(desc.env, pc);
|
phys_pc = get_page_addr_code(desc.env, s.pc);
|
||||||
if (phys_pc == -1) {
|
if (phys_pc == -1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
desc.page_addr0 = phys_pc;
|
desc.page_addr0 = phys_pc;
|
||||||
h = tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc),
|
h = tb_hash_func(phys_pc, (s.cflags & CF_PCREL ? 0 : s.pc),
|
||||||
flags, cs_base, cflags);
|
s.flags, s.cs_base, s.cflags);
|
||||||
return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp);
|
return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +251,7 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, TCGTBCPUState s)
|
||||||
goto hit;
|
goto hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
tb = tb_htable_lookup(cpu, s.pc, s.cs_base, s.flags, s.cflags);
|
tb = tb_htable_lookup(cpu, s);
|
||||||
if (tb == NULL) {
|
if (tb == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue