From 932e71cd57bab4e6206e1355c6425290721bbe34 Mon Sep 17 00:00:00 2001 From: aurel32 Date: Mon, 12 Jan 2009 21:33:13 +0000 Subject: target-mips: get rid of tests on env->user_mode_only Replace runtime checks on env->user_mode_only by compile time checks on CONFIG_USER_ONLY. Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6276 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-mips/translate_init.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'target-mips/translate_init.c') diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index 7ec82b0..d0243aa 100644 --- a/target-mips/translate_init.c +++ b/target-mips/translate_init.c @@ -495,14 +495,14 @@ static void fpu_init (CPUMIPSState *env, const mips_def_t *def) env->fpus[i].fcr0 = def->CP1_fcr0; memcpy(&env->active_fpu, &env->fpus[0], sizeof(env->active_fpu)); - if (env->user_mode_only) { - if (env->CP0_Config1 & (1 << CP0C1_FP)) - env->hflags |= MIPS_HFLAG_FPU; +#if defined(CONFIG_USER_ONLY) + if (env->CP0_Config1 & (1 << CP0C1_FP)) + env->hflags |= MIPS_HFLAG_FPU; #ifdef TARGET_MIPS64 - if (env->active_fpu.fcr0 & (1 << FCR0_F64)) - env->hflags |= MIPS_HFLAG_F64; + if (env->active_fpu.fcr0 & (1 << FCR0_F64)) + env->hflags |= MIPS_HFLAG_F64; +#endif #endif - } } static void mvp_init (CPUMIPSState *env, const mips_def_t *def) @@ -520,9 +520,10 @@ static void mvp_init (CPUMIPSState *env, const mips_def_t *def) // (0x04 << CP0MVPC0_PTC); (1 << CP0MVPC0_TCA) | (0x0 << CP0MVPC0_PVPE) | (0x04 << CP0MVPC0_PTC); +#if !defined(CONFIG_USER_ONLY) /* Usermode has no TLB support */ - if (!env->user_mode_only) - env->mvp->CP0_MVPConf0 |= (env->tlb->nb_tlb << CP0MVPC0_PTLBE); + env->mvp->CP0_MVPConf0 |= (env->tlb->nb_tlb << CP0MVPC0_PTLBE); +#endif /* Allocatable CP1 have media extensions, allocatable CP1 have FP support, no UDI implemented, no CP2 implemented, 1 CP1 implemented. */ @@ -572,8 +573,7 @@ static int cpu_mips_register (CPUMIPSState *env, const mips_def_t *def) env->insn_flags = def->insn_flags; #ifndef CONFIG_USER_ONLY - if (!env->user_mode_only) - mmu_init(env, def); + mmu_init(env, def); #endif fpu_init(env, def); mvp_init(env, def); -- cgit v1.1