mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 12:32:05 -06:00
accel/tcg: Use TCGTBCPUState in struct tb_desc
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
088caf3de4
commit
cec7176a23
1 changed files with 7 additions and 13 deletions
|
@ -150,12 +150,9 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu)
|
||||||
#endif /* CONFIG USER ONLY */
|
#endif /* CONFIG USER ONLY */
|
||||||
|
|
||||||
struct tb_desc {
|
struct tb_desc {
|
||||||
vaddr pc;
|
TCGTBCPUState s;
|
||||||
uint64_t cs_base;
|
|
||||||
CPUArchState *env;
|
CPUArchState *env;
|
||||||
tb_page_addr_t page_addr0;
|
tb_page_addr_t page_addr0;
|
||||||
uint32_t flags;
|
|
||||||
uint32_t cflags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool tb_lookup_cmp(const void *p, const void *d)
|
static bool tb_lookup_cmp(const void *p, const void *d)
|
||||||
|
@ -163,11 +160,11 @@ static bool tb_lookup_cmp(const void *p, const void *d)
|
||||||
const TranslationBlock *tb = p;
|
const TranslationBlock *tb = p;
|
||||||
const struct tb_desc *desc = d;
|
const struct tb_desc *desc = d;
|
||||||
|
|
||||||
if ((tb_cflags(tb) & CF_PCREL || tb->pc == desc->pc) &&
|
if ((tb_cflags(tb) & CF_PCREL || tb->pc == desc->s.pc) &&
|
||||||
tb_page_addr0(tb) == desc->page_addr0 &&
|
tb_page_addr0(tb) == desc->page_addr0 &&
|
||||||
tb->cs_base == desc->cs_base &&
|
tb->cs_base == desc->s.cs_base &&
|
||||||
tb->flags == desc->flags &&
|
tb->flags == desc->s.flags &&
|
||||||
tb_cflags(tb) == desc->cflags) {
|
tb_cflags(tb) == desc->s.cflags) {
|
||||||
/* check next page if needed */
|
/* check next page if needed */
|
||||||
tb_page_addr_t tb_phys_page1 = tb_page_addr1(tb);
|
tb_page_addr_t tb_phys_page1 = tb_page_addr1(tb);
|
||||||
if (tb_phys_page1 == -1) {
|
if (tb_phys_page1 == -1) {
|
||||||
|
@ -185,7 +182,7 @@ static bool tb_lookup_cmp(const void *p, const void *d)
|
||||||
* is different for the new TB. Therefore any exception raised
|
* is different for the new TB. Therefore any exception raised
|
||||||
* here by the faulting lookup is not premature.
|
* here by the faulting lookup is not premature.
|
||||||
*/
|
*/
|
||||||
virt_page1 = TARGET_PAGE_ALIGN(desc->pc);
|
virt_page1 = TARGET_PAGE_ALIGN(desc->s.pc);
|
||||||
phys_page1 = get_page_addr_code(desc->env, virt_page1);
|
phys_page1 = get_page_addr_code(desc->env, virt_page1);
|
||||||
if (tb_phys_page1 == phys_page1) {
|
if (tb_phys_page1 == phys_page1) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -201,11 +198,8 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, TCGTBCPUState s)
|
||||||
struct tb_desc desc;
|
struct tb_desc desc;
|
||||||
uint32_t h;
|
uint32_t h;
|
||||||
|
|
||||||
|
desc.s = s;
|
||||||
desc.env = cpu_env(cpu);
|
desc.env = cpu_env(cpu);
|
||||||
desc.cs_base = s.cs_base;
|
|
||||||
desc.flags = s.flags;
|
|
||||||
desc.cflags = s.cflags;
|
|
||||||
desc.pc = s.pc;
|
|
||||||
phys_pc = get_page_addr_code(desc.env, s.pc);
|
phys_pc = get_page_addr_code(desc.env, s.pc);
|
||||||
if (phys_pc == -1) {
|
if (phys_pc == -1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue