accel/tcg: Include missing 'exec/translation-block.h' header
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 13 Nov 2024 21:46:13 +0000 (22:46 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 20 Dec 2024 16:44:57 +0000 (17:44 +0100)
commit68df8c8dba57f539d24f1a92a8699a179d9bb6fb
tree804be774d51543f5d742bb968ea968e084e5a71b
parent8865049bab9957eb5b027d3e53bd05316817ea07
accel/tcg: Include missing 'exec/translation-block.h' header

TB compile flags, tb_page_addr_t type, tb_cflags() and few
other methods are defined in "exec/translation-block.h".

All these files don't include "exec/translation-block.h" but
include "exec/exec-all.h" which include it. Explicitly include
"exec/translation-block.h" to be able to remove it from
"exec/exec-all.h" later when it won't be necessary. Otherwise
we'd get errors such:

  accel/tcg/internal-target.h:59:20: error: a parameter list without types is only allowed in a function definition
     59 | void tb_lock_page0(tb_page_addr_t);
        |                    ^
  accel/tcg/tb-hash.h:64:23: error: unknown type name 'tb_page_addr_t'
     64 | uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
        |                       ^
  accel/tcg/tcg-accel-ops.c:62:36: error: use of undeclared identifier 'CF_CLUSTER_SHIFT'
     62 |     cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
        |                                    ^
  accel/tcg/watchpoint.c:102:47: error: use of undeclared identifier 'CF_NOIRQ'
    102 |                     cpu->cflags_next_tb = 1 | CF_NOIRQ | curr_cflags(cpu);
        |                                               ^
  target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL'
    536 |     if (tcg_cflags_has(cs, CF_PCREL)) {
        |                            ^
  target/rx/cpu.c:51:21: error: incomplete definition of type 'struct TranslationBlock'
     51 |     cpu->env.pc = tb->pc;
        |                   ~~^
  system/physmem.c:2977:9: error: call to undeclared function 'tb_invalidate_phys_range'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   2977 |         tb_invalidate_phys_range(addr, addr + length - 1);
        |         ^
  plugins/api.c:96:12: error: call to undeclared function 'tb_cflags'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     96 |     return tb_cflags(tcg_ctx->gen_tb) & CF_MEMI_ONLY;
        |            ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241114011310.3615-5-philmd@linaro.org>
25 files changed:
accel/tcg/internal-target.h
accel/tcg/tb-hash.h
cpu-target.c
linux-user/elfload.c
plugins/api.c
system/physmem.c
target/alpha/cpu.c
target/alpha/translate.c
target/arm/helper.c
target/arm/tcg/translate.h
target/avr/translate.c
target/hppa/translate.c
target/i386/tcg/tcg-cpu.c
target/i386/tcg/translate.c
target/m68k/translate.c
target/microblaze/translate.c
target/openrisc/translate.c
target/ppc/translate.c
target/riscv/translate.c
target/rx/translate.c
target/s390x/tcg/translate.c
target/sh4/translate.c
target/sparc/translate.c
target/tricore/translate.c
target/xtensa/translate.c