On 1/17/21 5:48 PM, Philippe Mathieu-Daudé wrote: > tb_flush_jmp_cache() is only called within TCG accelerator, > declare it locally. > > Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> > --- > We could also inline it in cputlb.c, the single user.
That is what I was thinking, I would be more inclined to put it as a static function there. Thanks, Claudio > --- > accel/tcg/internal.h | 16 ++++++++++++++++ > include/exec/exec-all.h | 3 --- > accel/tcg/cputlb.c | 1 + > accel/tcg/translate-all.c | 1 + > 4 files changed, 18 insertions(+), 3 deletions(-) > create mode 100644 accel/tcg/internal.h > > diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h > new file mode 100644 > index 00000000000..4981d98dbfd > --- /dev/null > +++ b/accel/tcg/internal.h > @@ -0,0 +1,16 @@ > +/* > + * internal execution defines for qemu > + * > + * Copyright (c) 2003 Fabrice Bellard > + * > + * SPDX-License-Identifier: LGPL-2.1-or-later > + */ > + > +#ifndef ACCEL_TCG_INTERNAL_H > +#define ACCEL_TCG_INTERNAL_H > + > +#include "exec/exec-all.h" > + > +void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); > + > +#endif > diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h > index 516013e735a..1e3e7cf8e78 100644 > --- a/include/exec/exec-all.h > +++ b/include/exec/exec-all.h > @@ -663,9 +663,6 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState > *env, target_ulong addr, > void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); > void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); > > -/* exec.c */ > -void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); > - > MemoryRegionSection * > address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, > hwaddr *xlat, hwaddr *plen, > diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c > index ced3dc077ec..b1f0f404aa5 100644 > --- a/accel/tcg/cputlb.c > +++ b/accel/tcg/cputlb.c > @@ -36,6 +36,7 @@ > #include "exec/translate-all.h" > #include "trace/trace-root.h" > #include "trace/mem.h" > +#include "internal.h" > #ifdef CONFIG_PLUGIN > #include "qemu/plugin-memory.h" > #endif > diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c > index ca7ef6aa177..6427bf87ae0 100644 > --- a/accel/tcg/translate-all.c > +++ b/accel/tcg/translate-all.c > @@ -60,6 +60,7 @@ > #include "sysemu/cpu-timers.h" > #include "sysemu/tcg.h" > #include "qapi/error.h" > +#include "internal.h" > > /* #define DEBUG_TB_INVALIDATE */ > /* #define DEBUG_TB_FLUSH */ >