Skip to content

Commit

Permalink
exec-all: rename tb_free to tb_remove
Browse files Browse the repository at this point in the history
We don't really free anything in this function anymore; we just remove
the TB from the binary search tree.

Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
cota authored and rth7680 committed Oct 24, 2017
1 parent 2ac01d6 commit be1e011
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion accel/tcg/cpu-exec.c
Expand Up @@ -220,7 +220,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,

tb_lock();
tb_phys_invalidate(tb, -1);
tb_free(tb);
tb_remove(tb);
tb_unlock();
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions accel/tcg/translate-all.c
Expand Up @@ -373,7 +373,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
if (tb->cflags & CF_NOCACHE) {
/* one-shot translation, invalidate it immediately */
tb_phys_invalidate(tb, -1);
tb_free(tb);
tb_remove(tb);
}
r = true;
}
Expand Down Expand Up @@ -872,7 +872,7 @@ static TranslationBlock *tb_alloc(target_ulong pc)
}

/* Called with tb_lock held. */
void tb_free(TranslationBlock *tb)
void tb_remove(TranslationBlock *tb)
{
assert_tb_locked();

Expand Down Expand Up @@ -1811,7 +1811,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
* cpu_exec_nocache() */
tb_phys_invalidate(tb->orig_tb, -1);
}
tb_free(tb);
tb_remove(tb);
}

/* TODO: If env->pc != tb->pc (i.e. the faulting instruction was not
Expand Down
2 changes: 1 addition & 1 deletion include/exec/exec-all.h
Expand Up @@ -388,7 +388,7 @@ static inline uint32_t curr_cflags(void)
| (use_icount ? CF_USE_ICOUNT : 0);
}

void tb_free(TranslationBlock *tb);
void tb_remove(TranslationBlock *tb);
void tb_flush(CPUState *cpu);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,
Expand Down

0 comments on commit be1e011

Please sign in to comment.