Ignore:
Timestamp:
May 14, 2002, 5:45:36 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
19131e97
Parents:
06549dcf
Message:

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

  • src/threaddispatch.c, src/threadhandler.c: 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
  • c/src/exec/score/src/threadhandler.c

    r06549dcf r48f89683  
    7979#endif
    8080
     81#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     82#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
     83  if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) {
     84    if ( _Thread_Allocated_fp != NULL )
     85      _Context_Save_fp( &_Thread_Allocated_fp->fp_context );
     86    _Thread_Allocated_fp = executing;
     87  }
     88#endif
     89#endif
     90
     91
    8192  /*
    8293   * Take care that 'begin' extensions get to complete before
Note: See TracChangeset for help on using the changeset viewer.