[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code |
Date: |
Tue, 25 May 2021 15:02:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 5/25/21 1:53 PM, Bruno Larsen (billionai) wrote:
> excp_helper.c, mmu-hash64.c and mmu_helper.c have some function
> declarations that are TCG-only, and couldn't be easily moved to a
> TCG only file, so ifdefs were added around them.
>
> We also needed ifdefs around some header files because helper-proto.h
> includes trace/generated-helpers.h, which is never created when building
> without TCG, and cpu_ldst.h includes tcg/tcg.h, whose containing folder
> is not included as a -iquote. As future cleanup, we could change the
> part of the configuration script to add those.
>
> cpu_init.c also had a callback definition that is TCG only and could be
> removed as part of a future cleanup (all the dump_statistics part is
> almost never used and will become obsolete as we transition to using
> decodetree).
>
> Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> ---
> target/ppc/cpu_init.c | 2 ++
> target/ppc/excp_helper.c | 21 ++++++++++++++++++---
> target/ppc/mmu-hash64.c | 11 ++++++++++-
> target/ppc/mmu_helper.c | 16 ++++++++++++++--
> 4 files changed, 44 insertions(+), 6 deletions(-)
Please have a look at commit range 0a31c16c9ce..a2b0a27d33e
for the MIPS convertion.
> #if !defined(CONFIG_USER_ONLY)
> +#ifdef CONFIG_TCG
> void helper_store_msr(CPUPPCState *env, target_ulong val)
> {
For example this one is similar to commit d60146a9389, you
could simply move this function to tcg/sysemu/msr_helpers.c
and modify the meson file, then when TCG is not available,
the file isn't built, without having to use #ifdef'ry.