Module Name: src Committed By: matt Date: Mon Nov 18 18:02:01 UTC 2013
Modified Files: src/sys/arch/arm/vfp: vfp_init.c Log Message: Before checking for an exception, make sure we own the VFP. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/vfp/vfp_init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/vfp/vfp_init.c diff -u src/sys/arch/arm/vfp/vfp_init.c:1.26 src/sys/arch/arm/vfp/vfp_init.c:1.27 --- src/sys/arch/arm/vfp/vfp_init.c:1.26 Fri Aug 23 18:11:47 2013 +++ src/sys/arch/arm/vfp/vfp_init.c Mon Nov 18 18:02:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vfp_init.c,v 1.26 2013/08/23 18:11:47 matt Exp $ */ +/* $NetBSD: vfp_init.c,v 1.27 2013/11/18 18:02:01 matt Exp $ */ /* * Copyright (c) 2008 ARM Ltd @@ -374,9 +374,21 @@ vfp_handler(u_int address, u_int insn, t if (fault_code != FAULT_USER) panic("VFP fault at %#x in non-user mode", frame->tf_pc); - if (ci->ci_vfp_id == 0) + if (ci->ci_vfp_id == 0) { /* No VFP detected, just fault. */ return 1; + } + + /* + * If we are just changing/fetching FPSCR, don't bother loading it. + */ + if (!vfp_fpscr_handler(address, insn, frame, fault_code)) + return 0; + + /* + * Make sure we own the FP. + */ + pcu_load(&arm_vfp_ops); uint32_t fpexc = armreg_fpexc_read(); if (fpexc & VFP_FPEXC_EX) { @@ -411,14 +423,6 @@ vfp_handler(u_int address, u_int insn, t return 0; } - /* - * If we are just changing/fetching FPSCR, don't bother loading it. - */ - if (!vfp_fpscr_handler(address, insn, frame, fault_code)) - return 0; - - pcu_load(&arm_vfp_ops); - /* Need to restart the faulted instruction. */ // frame->tf_pc -= INSN_SIZE; return 0;