mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-06-04 19:58:15 +00:00
cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find
Reusing the have_tb_lock name, which is also defined in translate-all.c, makes code reviewing unnecessarily harder. Avoid potential confusion by renaming the local have_tb_lock variable to something else. Backports commit 841710c78e022cbc1f798cced035789725702dac from qemu
This commit is contained in:
parent
f1d6630893
commit
921c71a9ee
|
@ -205,7 +205,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
target_ulong cs_base, pc;
|
target_ulong cs_base, pc;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
bool have_tb_lock = false;
|
bool acquired_tb_lock = false;
|
||||||
|
|
||||||
/* we record a subset of the CPU state. It will
|
/* we record a subset of the CPU state. It will
|
||||||
always be the same before a given translated block
|
always be the same before a given translated block
|
||||||
|
@ -224,7 +224,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
|
||||||
mmap_lock();
|
mmap_lock();
|
||||||
// Unicorn: commented out
|
// Unicorn: commented out
|
||||||
//tb_lock();
|
//tb_lock();
|
||||||
have_tb_lock = true;
|
acquired_tb_lock = true;
|
||||||
|
|
||||||
/* There's a chance that our desired tb has been translated while
|
/* There's a chance that our desired tb has been translated while
|
||||||
* taking the locks so we check again inside the lock.
|
* taking the locks so we check again inside the lock.
|
||||||
|
@ -253,10 +253,10 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
|
||||||
#endif
|
#endif
|
||||||
/* See if we can patch the calling TB. */
|
/* See if we can patch the calling TB. */
|
||||||
if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
|
if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
|
||||||
if (!have_tb_lock) {
|
if (!acquired_tb_lock) {
|
||||||
// Unicorn: commented out
|
// Unicorn: commented out
|
||||||
//tb_lock();
|
//tb_lock();
|
||||||
have_tb_lock = true;
|
acquired_tb_lock = true;
|
||||||
}
|
}
|
||||||
/* Check if translation buffer has been flushed */
|
/* Check if translation buffer has been flushed */
|
||||||
if (cpu->tb_flushed) {
|
if (cpu->tb_flushed) {
|
||||||
|
@ -265,7 +265,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
|
||||||
tb_add_jump(last_tb, tb_exit, tb);
|
tb_add_jump(last_tb, tb_exit, tb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (have_tb_lock) {
|
if (acquired_tb_lock) {
|
||||||
// Unicorn: commented out
|
// Unicorn: commented out
|
||||||
//tb_unlock();
|
//tb_unlock();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue