[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state() |
Date: |
Fri, 20 Dec 2024 17:15:33 +0100 |
From: Anton Johansson <anjo@rev.ng>
Required to compile accel/tcg/translate-all.c once for softmmu targets.
The function gets quite big for some targets so uninlining makes sense.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Anton Johansson<anjo@rev.ng>
Message-Id: <20240119144024.14289-14-anjo@rev.ng>
[PMD: Only take SPARC part]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sparc/cpu.h | 39 ++-------------------------------------
target/sparc/cpu.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 37 deletions(-)
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index f517e5a383b..e9ccec6175f 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -747,43 +747,8 @@ trap_state* cpu_tsptr(CPUSPARCState* env);
#define TB_FLAG_FSR_QNE (1 << 8)
#define TB_FLAG_ASI_SHIFT 24
-static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc,
- uint64_t *cs_base, uint32_t *pflags)
-{
- uint32_t flags;
- *pc = env->pc;
- *cs_base = env->npc;
- flags = cpu_mmu_index(env_cpu(env), false);
-#ifndef CONFIG_USER_ONLY
- if (cpu_supervisor_mode(env)) {
- flags |= TB_FLAG_SUPER;
- }
-#endif
-#ifdef TARGET_SPARC64
-#ifndef CONFIG_USER_ONLY
- if (cpu_hypervisor_mode(env)) {
- flags |= TB_FLAG_HYPER;
- }
-#endif
- if (env->pstate & PS_AM) {
- flags |= TB_FLAG_AM_ENABLED;
- }
- if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) {
- flags |= TB_FLAG_FPU_ENABLED;
- }
- flags |= env->asi << TB_FLAG_ASI_SHIFT;
-#else
- if (env->psref) {
- flags |= TB_FLAG_FPU_ENABLED;
- }
-#ifndef CONFIG_USER_ONLY
- if (env->fsr_qne) {
- flags |= TB_FLAG_FSR_QNE;
- }
-#endif /* !CONFIG_USER_ONLY */
-#endif /* TARGET_SPARC64 */
- *pflags = flags;
-}
+void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc,
+ uint64_t *cs_base, uint32_t *pflags);
static inline bool tb_fpu_enabled(int tb_flags)
{
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 8f494c286ae..b11f3248d82 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -713,6 +713,44 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs,
cpu->env.npc = tb->cs_base;
}
+void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc,
+ uint64_t *cs_base, uint32_t *pflags)
+{
+ uint32_t flags;
+ *pc = env->pc;
+ *cs_base = env->npc;
+ flags = cpu_mmu_index(env_cpu(env), false);
+#ifndef CONFIG_USER_ONLY
+ if (cpu_supervisor_mode(env)) {
+ flags |= TB_FLAG_SUPER;
+ }
+#endif
+#ifdef TARGET_SPARC64
+#ifndef CONFIG_USER_ONLY
+ if (cpu_hypervisor_mode(env)) {
+ flags |= TB_FLAG_HYPER;
+ }
+#endif
+ if (env->pstate & PS_AM) {
+ flags |= TB_FLAG_AM_ENABLED;
+ }
+ if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) {
+ flags |= TB_FLAG_FPU_ENABLED;
+ }
+ flags |= env->asi << TB_FLAG_ASI_SHIFT;
+#else
+ if (env->psref) {
+ flags |= TB_FLAG_FPU_ENABLED;
+ }
+#ifndef CONFIG_USER_ONLY
+ if (env->fsr_qne) {
+ flags |= TB_FLAG_FSR_QNE;
+ }
+#endif /* !CONFIG_USER_ONLY */
+#endif /* TARGET_SPARC64 */
+ *pflags = flags;
+}
+
static bool sparc_cpu_has_work(CPUState *cs)
{
return (cs->interrupt_request & CPU_INTERRUPT_HARD) &&
--
2.47.1
- [PULL 28/59] system: Remove unnecessary 'exec/translate-all.h' include, (continued)
- [PULL 28/59] system: Remove unnecessary 'exec/translate-all.h' include, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 31/59] accel/tcg: Move TranslationBlock declarations to 'tb-internal.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 33/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 35/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 39/59] user: Declare cpu_loop() once in 'user/cpu_loop.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 37/59] user: Forward declare target_cpu_copy_regs structure, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 40/59] user: Move various declarations out of 'exec/exec-all.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 41/59] target/loongarch: Declare loongarch_cpu_dump_state() locally, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 43/59] target/sparc: Move sparc_restore_state_to_opc() to cpu.c, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state(),
Philippe Mathieu-Daudé <=
- [PULL 44/59] exec/cpu-all: Include 'cpu.h' earlier so MMU_USER_IDX is always defined, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 45/59] accel/tcg: Declare cpu_loop_exit_requested() in 'exec/cpu-common.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 46/59] exec/translation-block: Include missing 'qemu/atomic.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 47/59] qemu/coroutine: Include missing 'qemu/atomic.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 48/59] accel/tcg: Restrict curr_cflags() declaration to 'internal-common.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 49/59] accel/tcg: Move tcg_cflags_has/set() to 'exec/translation-block.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 50/59] accel/tcg: Include missing 'exec/translation-block.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 51/59] accel/tcg: Un-inline translator_is_same_page(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 52/59] target/xtensa: Remove tswap() calls in semihosting simcall() helper, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 53/59] target/mips: Remove tswap() calls in semihosting uhi_fstat_cb(), Philippe Mathieu-Daudé, 2024/12/20