mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target/sparc: Uninline cpu_get_tb_cpu_state()
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>
This commit is contained in:
parent
92b3938ca6
commit
32cf0ac2cc
2 changed files with 40 additions and 37 deletions
|
@ -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) &&
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue