target: Set TCGCPUOps::cpu_exec_halt to target's has_work implementation
commit4f7b1ecba81c9dab8066e891ead8a4fff95781af
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 4 Jul 2024 15:57:10 +0000 (4 16:57 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jul 2024 10:41:34 +0000 (11 11:41 +0100)
tree66dc2e1823447fbe28bbd33a93417b5af97ae8a7
parentfcee3707eb0331a7270d9c93ba68e832e8ff8b98
target: Set TCGCPUOps::cpu_exec_halt to target's has_work implementation

Currently the TCGCPUOps::cpu_exec_halt method is optional, and if it
is not set then the default is to call the CPUClass::has_work
method (which has an identical function signature).

We would like to make the cpu_exec_halt method mandatory so we can
remove the runtime check and fallback handling.  In preparation for
that, make all the targets which don't need special handling in their
cpu_exec_halt set it to their cpu_has_work implementation instead of
leaving it unset.  (This is every target except for arm and i386.)

In the riscv case this requires us to make the function not
be local to the source file it's defined in.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
19 files changed:
target/alpha/cpu.c
target/avr/cpu.c
target/cris/cpu.c
target/hppa/cpu.c
target/loongarch/cpu.c
target/m68k/cpu.c
target/microblaze/cpu.c
target/mips/cpu.c
target/openrisc/cpu.c
target/ppc/cpu_init.c
target/riscv/cpu.c
target/riscv/internals.h
target/riscv/tcg/tcg-cpu.c
target/rx/cpu.c
target/s390x/cpu.c
target/sh4/cpu.c
target/sparc/cpu.c
target/tricore/cpu.c
target/xtensa/cpu.c