From patchwork Fri Dec 3 13:36:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [06/16] ARM: enable XScale/iWMMXT in linux-user mode Date: Fri, 03 Dec 2010 03:36:33 -0000 From: Riku@afflict.kos.to, Voipio@afflict.kos.to X-Patchwork-Id: 74148 Message-Id: <3a807decfa5245d3eb50c9301e73fc5da4a484e1.1291382447.git.riku.voipio@nokia.com> To: qemu-devel@nongnu.org Cc: Peter Maydell From: Peter Maydell In linux-user mode, the XScale/iWMMXT coprocessors must be enabled at reset so that we can run code that uses these instructions. Signed-off-by: Peter Maydell --- target-arm/helper.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 996d40d..94aef39 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -203,7 +203,13 @@ void cpu_reset(CPUARMState *env) cpu_reset_model_id(env, id); #if defined (CONFIG_USER_ONLY) env->uncached_cpsr = ARM_CPU_MODE_USR; + /* For user mode we must enable access to coprocessors */ env->vfp.xregs[ARM_VFP_FPEXC] = 1 << 30; + if (arm_feature(env, ARM_FEATURE_IWMMXT)) { + env->cp15.c15_cpar = 3; + } else if (arm_feature(env, ARM_FEATURE_XSCALE)) { + env->cp15.c15_cpar = 1; + } #else /* SVC mode with interrupts disabled. */ env->uncached_cpsr = ARM_CPU_MODE_SVC | CPSR_A | CPSR_F | CPSR_I;