summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2006-06-19 19:57:01 +0000
committerTill Straumann <strauman@slac.stanford.edu>2006-06-19 19:57:01 +0000
commitbbc87852db86fd022cc7a019d71055c43558ea6c (patch)
treef9f1552b018481e0f65e0f27292951b51c2e1886 /c
parent Never allow the FPU to be switched on for integer-only tasks (diff)
downloadrtems-bbc87852db86fd022cc7a019d71055c43558ea6c.tar.bz2
Never allow the FPU to be switched on for integer-only tasks
(new gcc may use FP regs implicitely).
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libcpu/powerpc/ChangeLog7
-rw-r--r--c/src/lib/libcpu/powerpc/new-exceptions/cpu.c20
2 files changed, 16 insertions, 11 deletions
diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog
index 3bd788c8bf..48066f35ae 100644
--- a/c/src/lib/libcpu/powerpc/ChangeLog
+++ b/c/src/lib/libcpu/powerpc/ChangeLog
@@ -1,4 +1,9 @@
-2006-05-16 Ralf Corsépius <ralf.corsepius@rtems.org>
+2006-06-19 Till Straumann <strauman@slac.stanford.edu>
+
+ * new-exceptions/cpu.c: Never allow the FPU to be switched
+ on for integer-only tasks (new gcc may use FP regs implicitely).
+
+2006-05-16 Ralf Corsepius <ralf.corsepius@rtems.org>
* configure.ac: Use RTEMS_AMPOLISH3.
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c
index 8151ce15e9..19ba358cad 100644
--- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c
+++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c
@@ -104,20 +104,20 @@ void _CPU_Context_Initialize(
* time (7 July 1997), this restructuring is not being done.
*/
- /* Till Straumann: For deferred FPContext save/restore, make sure integer
- * tasks have no FPU access in order to catch violations.
- * Otherwise, the FP registers may be corrupted.
- * Since we set the_contex->msr using our current MSR,
- * we must make sure MSR_FP is off if (!is_fp)...
+ /* Make sure integer tasks have no FPU access in order to
+ * catch violations. Gcc may implicitely use the FPU and
+ * data corruption may happen.
+ * Since we set the_contex->msr using our current MSR,
+ * we must make sure MSR_FP is off if (!is_fp)...
+ * Unfortunately, this means that users of vfprintf_r have to use FP
+ * tasks or fix vfprintf. Furthermore, users of int-only tasks
+ * must prevent gcc from using the FPU (currently -msoft-float is the
+ * only way...)
*/
-#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
if ( is_fp )
-#endif
the_context->msr |= PPC_MSR_FP;
-#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
else
- the_context->msr &= ~PPC_MSR_FP;
-#endif
+ the_context->msr &= ~PPC_MSR_FP;
the_context->pc = (uint32_t)entry_point;