diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-10-03 14:30:25 +0200 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-10-03 08:00:25 -0700 |
commit | 23af78b070ebfc0bfa8f114796a2eb9b5ed31e92 (patch) | |
tree | 869d71eb6842442b5a5911600b7729f0335db2f4 /accel | |
parent | fa312f2eaf50d7abb84dcc0d9b5d15f1ddf6f66b (diff) | |
download | qemu-23af78b070ebfc0bfa8f114796a2eb9b5ed31e92.zip qemu-23af78b070ebfc0bfa8f114796a2eb9b5ed31e92.tar.gz qemu-23af78b070ebfc0bfa8f114796a2eb9b5ed31e92.tar.bz2 |
accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG
We don't need to expose these TCG-specific methods to the
whole code base. Register them as AccelClass handlers, they
will be called by the generic accel_cpu_[un]realize() methods.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20231003123026.99229-8-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/tcg/internal.h | 3 | ||||
-rw-r--r-- | accel/tcg/tcg-all.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index e8cbbde..57ab397 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -80,6 +80,9 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, uintptr_t host_pc); +bool tcg_exec_realizefn(CPUState *cpu, Error **errp); +void tcg_exec_unrealizefn(CPUState *cpu); + /* Return the current PC from CPU, which may be cached in TB. */ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) { diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 03dfd67..8ab873a 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -227,6 +227,8 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data) AccelClass *ac = ACCEL_CLASS(oc); ac->name = "tcg"; ac->init_machine = tcg_init_machine; + ac->cpu_common_realize = tcg_exec_realizefn; + ac->cpu_common_unrealize = tcg_exec_unrealizefn; ac->allowed = &tcg_allowed; ac->gdbstub_supported_sstep_flags = tcg_gdbstub_supported_sstep_flags; |