From 247bf011f67c4037df7bfcd11ff0106e06f439c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20F=C3=A4rber?= Date: Tue, 4 Mar 2014 01:26:33 +0100 Subject: [PATCH] target-sparc: Defer SPARCCPU feature inference to QOM realize MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gets it out of cpu_sparc_register() and aligns with target-arm. Tested-by: Mark Cave-Ayland Signed-off-by: Andreas Färber --- target-sparc/cpu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c index c4ef204df3..9a315c8d4c 100644 --- a/target-sparc/cpu.c +++ b/target-sparc/cpu.c @@ -96,11 +96,6 @@ static int cpu_sparc_register(SPARCCPU *cpu, const char *cpu_model) return -1; } -#if defined(CONFIG_USER_ONLY) - if ((env->def->features & CPU_FEATURE_FLOAT)) { - env->def->features |= CPU_FEATURE_FLOAT128; - } -#endif env->version = def->iu_version; env->fsr = def->fpu_version; env->nwindows = def->nwindows; @@ -767,6 +762,14 @@ static bool sparc_cpu_has_work(CPUState *cs) static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) { SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(dev); +#if defined(CONFIG_USER_ONLY) + SPARCCPU *cpu = SPARC_CPU(dev); + CPUSPARCState *env = &cpu->env; + + if ((env->def->features & CPU_FEATURE_FLOAT)) { + env->def->features |= CPU_FEATURE_FLOAT128; + } +#endif qemu_init_vcpu(CPU(dev)); -- 2.11.4.GIT