Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/vfp Before checking for an exception, make sure...
details: https://anonhg.NetBSD.org/src/rev/67708d5c7eb0
branches: trunk
changeset: 791441:67708d5c7eb0
user: matt <matt%NetBSD.org@localhost>
date: Mon Nov 18 18:02:01 2013 +0000
description:
Before checking for an exception, make sure we own the VFP.
diffstat:
sys/arch/arm/vfp/vfp_init.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diffs (47 lines):
diff -r daeed9fda929 -r 67708d5c7eb0 sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c Mon Nov 18 16:23:47 2013 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c Mon Nov 18 18:02:01 2013 +0000
@@ -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 @@
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 @@
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;
Home |
Main Index |
Thread Index |
Old Index