mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00

There is nothing special about this compile flag that doesn't mean we can't just compute it with curr_cflags() which we should be using when building a new set. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210224165811.11567-3-alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
|
|
*
|
|
* License: GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
#ifndef EXEC_TB_LOOKUP_H
|
|
#define EXEC_TB_LOOKUP_H
|
|
|
|
#ifdef NEED_CPU_H
|
|
#include "cpu.h"
|
|
#else
|
|
#include "exec/poison.h"
|
|
#endif
|
|
|
|
#include "exec/exec-all.h"
|
|
#include "exec/tb-hash.h"
|
|
|
|
/* Might cause an exception, so have a longjmp destination ready */
|
|
static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
|
|
target_ulong cs_base,
|
|
uint32_t flags, uint32_t cf_mask)
|
|
{
|
|
TranslationBlock *tb;
|
|
uint32_t hash;
|
|
|
|
hash = tb_jmp_cache_hash_func(pc);
|
|
tb = qatomic_rcu_read(&cpu->tb_jmp_cache[hash]);
|
|
|
|
if (likely(tb &&
|
|
tb->pc == pc &&
|
|
tb->cs_base == cs_base &&
|
|
tb->flags == flags &&
|
|
tb->trace_vcpu_dstate == *cpu->trace_dstate &&
|
|
(tb_cflags(tb) & (CF_HASH_MASK | CF_INVALID)) == cf_mask)) {
|
|
return tb;
|
|
}
|
|
tb = tb_htable_lookup(cpu, pc, cs_base, flags, cf_mask);
|
|
if (tb == NULL) {
|
|
return NULL;
|
|
}
|
|
qatomic_set(&cpu->tb_jmp_cache[hash], tb);
|
|
return tb;
|
|
}
|
|
|
|
#endif /* EXEC_TB_LOOKUP_H */
|