Changeset 19131e97 in rtems for cpukit/score


Ignore:
Timestamp:
May 14, 2002, 5:45:37 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
830e5f7
Parents:
48f89683
Message:

2001-05-14 Till Straumann <strauman@…>

  • 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_.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/powerpc/rtems/new-exceptions/cpu.h

    r48f89683 r19131e97  
    229229 *  Thus in a system with only one FP task, the FP context will never
    230230 *  be saved or restored.
     231 *
     232 *  Note, however that compilers may use floating point registers/
     233 *  instructions for optimization or they may save/restore FP registers
     234 *  on the stack. You must not use deferred switching in these cases
     235 *  and on the PowerPC attempting to do so will raise a "FP unavailable"
     236 *  exception.
    231237 */
    232238/*
     
    234240 */
    235241
    236 #define CPU_USE_DEFERRED_FP_SWITCH       TRUE
     242/* conservative setting (FALSE); probably doesn't affect performance too much */
     243#define CPU_USE_DEFERRED_FP_SWITCH       FALSE
    237244
    238245/*
Note: See TracChangeset for help on using the changeset viewer.