summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-05-14 17:45:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-05-14 17:45:37 +0000
commit19131e97448c53a4cbb58448f33e52e2b92cacfd (patch)
treebede62f70a99dc6d2f4b6f274f7e34b98be6e7cb /c/src/exec/score
parent2001-05-14 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-19131e97448c53a4cbb58448f33e52e2b92cacfd.tar.bz2
2001-05-14 Till Straumann <strauman@slac.stanford.edu>
* rtems/new-exceptions/cpu.h: Per PR211 fix saving/restoring floating point context. The fpsave and fprestore routines are only used in a executing context which _is_ fp and hence has the FPU enabled. The current behavior required the FPU always to be on which is very dangerous if lazy context switching is used. [Joel Note: Some ports explicitly enabled the FPU in the FP save and restore routines to avoid this.] The patch also makes sure (on powerpc only) that the FPU is disabled for integer tasks. Note that this is crucial if deferred fp context switching is used. Otherwise, fp context corruption may go undetected! Also note that even tasks which merely push/pop FP registers to/from the stack without modifying them still MUST be FP tasks - otherwise (if lazy FP context switching is used), FP register corruption (of other, FP, tasks may occur)! Furthermore, (on PPC) by default, lazy FP context save/restore is _disabled_.
Diffstat (limited to 'c/src/exec/score')
-rw-r--r--c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h b/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h
index 371626cd4b..6b30c0ed0b 100644
--- a/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h
+++ b/c/src/exec/score/cpu/powerpc/rtems/new-exceptions/cpu.h
@@ -228,12 +228,19 @@ extern "C" {
* until a context switch is made to another, different FP task.
* Thus in a system with only one FP task, the FP context will never
* be saved or restored.
+ *
+ * Note, however that compilers may use floating point registers/
+ * instructions for optimization or they may save/restore FP registers
+ * on the stack. You must not use deferred switching in these cases
+ * and on the PowerPC attempting to do so will raise a "FP unavailable"
+ * exception.
*/
/*
* ACB Note: This could make debugging tricky..
*/
-#define CPU_USE_DEFERRED_FP_SWITCH TRUE
+/* conservative setting (FALSE); probably doesn't affect performance too much */
+#define CPU_USE_DEFERRED_FP_SWITCH FALSE
/*
* Does this port provide a CPU dependent IDLE task implementation?