From bbc87852db86fd022cc7a019d71055c43558ea6c Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Mon, 19 Jun 2006 19:57:01 +0000 Subject: Never allow the FPU to be switched on for integer-only tasks (new gcc may use FP regs implicitely). --- c/src/lib/libcpu/powerpc/ChangeLog | 7 ++++++- c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'c') 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 +2006-06-19 Till Straumann + + * 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 * 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; -- cgit v1.2.3