Module Name:    src
Committed By:   matt
Date:           Tue Mar  4 08:32:23 UTC 2014

Modified Files:
        src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Add a different version vfp_fpscr_changable if FPU_VFP was not defined.
If no FPU was found, reinit vfp_fpscr_changeable/default to values appropriate
for softfloat.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.34 src/sys/arch/arm/vfp/vfp_init.c:1.35
--- src/sys/arch/arm/vfp/vfp_init.c:1.34	Mon Mar  3 08:45:18 2014
+++ src/sys/arch/arm/vfp/vfp_init.c	Tue Mar  4 08:32:23 2014
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.34 2014/03/03 08:45:18 matt Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.35 2014/03/04 08:32:23 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -44,9 +44,6 @@
 
 #include <uvm/uvm_extern.h>		/* for pmap.h */
 
-extern int cpu_media_and_vfp_features[];
-extern int cpu_neon_present;
-
 #ifdef FPU_VFP
 
 #ifdef CPU_CORTEX
@@ -171,6 +168,9 @@ vfp_test(u_int address, u_int insn, trap
 	return 0;
 }
 
+#else
+/* determine what bits can be changed */
+uint32_t vfp_fpscr_changable = VFP_FPSCR_CSUM|VFP_FPSCR_ESUM|VFP_FPSCR_RMODE;
 #endif /* FPU_VFP */
 
 struct evcnt vfp_fpscr_ev = 
@@ -201,8 +201,7 @@ vfp_fpscr_handler(u_int address, u_int i
 		return 1;
 
 	if (__predict_false(!vfp_used_p())) {
-		pcb->pcb_vfp.vfp_fpscr =
-		    (VFP_FPSCR_DN | VFP_FPSCR_FZ | VFP_FPSCR_RN); /* Runfast */
+		pcb->pcb_vfp.vfp_fpscr = vfp_fpscr_default;
 	}
 #endif
 
@@ -341,6 +340,9 @@ vfp_attach(void)
 		aprint_normal_dev(ci->ci_dev, "unrecognized VFP version %x\n",
 		    fpsid);
 		install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+		vfp_fpscr_changable = VFP_FPSCR_CSUM|VFP_FPSCR_ESUM
+		    |VFP_FPSCR_RMODE;
+		vfp_fpscr_default = 0;
 		return;
 	}
 

Reply via email to