Changeset 830e5f7 in rtems


Ignore:
Timestamp:
05/14/02 17:45:53 (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
a191b28
Parents:
19131e97
Message:

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

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

Location:
c/src/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/support/new_exception_processing/ChangeLog

    r19131e97 r830e5f7  
     12001-05-14      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * cpu.c: Per PR211 fix
     4        saving/restoring floating point context.  The fpsave and fprestore
     5        routines are only used in a executing context which _is_ fp and hence
     6        has the FPU enabled. The current behavior required the FPU always to
     7        be on which is very dangerous if lazy context switching is used. 
     8        [Joel Note: Some ports explicitly enabled the FPU in the FP save and
     9        restore routines to avoid this.]
     10
     11        The patch also makes sure (on powerpc only) that the FPU is disabled
     12        for integer tasks. Note that this is crucial if deferred fp context
     13        switching is used. Otherwise, fp context corruption may go undetected!
     14        Also note that even tasks which merely push/pop FP registers to/from
     15        the stack without modifying them still MUST be FP tasks - otherwise
     16        (if lazy FP context switching is used), FP register corruption (of
     17        other, FP, tasks may occur)!
     18
     19        Furthermore, (on PPC) by default, lazy FP context save/restore
     20        is _disabled_.
     21
    1222002-04-18      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    223
  • c/src/lib/libbsp/powerpc/support/new_exception_processing/cpu.c

    r19131e97 r830e5f7  
    9494   */
    9595
    96   /*if ( is_fp ) */
     96  /* Till Straumann: For deferred FPContext save/restore, make sure integer
     97   *                 tasks have no FPU access in order to catch violations.
     98   *                 Otherwise, the FP registers may be corrupted.
     99   *                             Since we set the_contex->msr using our current MSR,
     100   *                             we must make sure MSR_FP is off if (!is_fp)...
     101   */
     102#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
     103  if ( is_fp )
     104#endif
    97105    the_context->msr |= PPC_MSR_FP;
     106#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
     107  else
     108        the_context->msr &= ~PPC_MSR_FP;
     109#endif
    98110
    99111  the_context->pc = (unsigned32)entry_point;
  • c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog

    r19131e97 r830e5f7  
     12001-05-14      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * cpu.c: Per PR211 fix
     4        saving/restoring floating point context.  The fpsave and fprestore
     5        routines are only used in a executing context which _is_ fp and hence
     6        has the FPU enabled. The current behavior required the FPU always to
     7        be on which is very dangerous if lazy context switching is used. 
     8        [Joel Note: Some ports explicitly enabled the FPU in the FP save and
     9        restore routines to avoid this.]
     10
     11        The patch also makes sure (on powerpc only) that the FPU is disabled
     12        for integer tasks. Note that this is crucial if deferred fp context
     13        switching is used. Otherwise, fp context corruption may go undetected!
     14        Also note that even tasks which merely push/pop FP registers to/from
     15        the stack without modifying them still MUST be FP tasks - otherwise
     16        (if lazy FP context switching is used), FP register corruption (of
     17        other, FP, tasks may occur)!
     18
     19        Furthermore, (on PPC) by default, lazy FP context save/restore
     20        is _disabled_.
     21
    1222002-04-18      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    223
  • c/src/lib/libcpu/powerpc/new-exceptions/cpu.c

    r19131e97 r830e5f7  
    9494   */
    9595
    96   /*if ( is_fp ) */
     96  /* Till Straumann: For deferred FPContext save/restore, make sure integer
     97   *                 tasks have no FPU access in order to catch violations.
     98   *                 Otherwise, the FP registers may be corrupted.
     99   *                             Since we set the_contex->msr using our current MSR,
     100   *                             we must make sure MSR_FP is off if (!is_fp)...
     101   */
     102#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
     103  if ( is_fp )
     104#endif
    97105    the_context->msr |= PPC_MSR_FP;
     106#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE)
     107  else
     108        the_context->msr &= ~PPC_MSR_FP;
     109#endif
    98110
    99111  the_context->pc = (unsigned32)entry_point;
Note: See TracChangeset for help on using the changeset viewer.