@samitouri / QOSamiQemu / commits / 3632840c3b

target/ppc: Restrict TCGTBCPUState to TCG

TCGTBCPUState is a structure used during TCG translation, therefore not needed when TCG is not available. Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260616153432.92939-4-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Jun 16, 2026 at 17:29 UTC 3632840c3b335fe728fb934d0e7f58df8d06c3b1
2 files changed +6 -2
target/ppc/helper_regs.c
+2 -1
@@ -27,7 +27,6 @@
27 #include "power8-pmu.h"
28 #include "cpu-models.h"
29 #include "spr_common.h"
30 -#include "accel/tcg/cpu-ops.h"
30 #include "internal.h"
31
32 /* Swap temporary saved registers with GPRs */
@@ -261,6 +260,7 @@ void hreg_update_pmu_hflags(CPUPPCState *env)
260 env->hflags |= hreg_compute_pmu_hflags_value(env);
261 }
262
263 +#ifdef CONFIG_TCG
264 TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs)
265 {
266 CPUPPCState *env = cpu_env(cs);
@@ -277,6 +277,7 @@ TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs)
277
278 return (TCGTBCPUState){ .pc = env->nip, .flags = hflags_current };
279 }
280 +#endif /* CONFIG_TCG */
281
282 #ifndef CONFIG_USER_ONLY
283 void cpu_interrupt_exittb(CPUState *cs)
target/ppc/internal.h
+4 -1
@@ -22,7 +22,6 @@
22 #include "exec/memop.h"
23 #include "hw/core/registerfields.h"
24 #include "exec/page-protection.h"
25 -#include "accel/tcg/tb-cpu-state.h"
25
26 static inline bool ppc_env_is_little_endian(const CPUPPCState *env)
27 {
@@ -326,6 +325,10 @@ static inline int ger_pack_masks(int pmsk, int ymsk, int xmsk)
325 return msk;
326 }
327
328 +#ifdef CONFIG_TCG
329 +#include "accel/tcg/tb-cpu-state.h"
330 +
331 TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs);
332 +#endif
333
334 #endif /* PPC_INTERNAL_H */