Changeset 27bfcd8 in rtems


Ignore:
Timestamp:
Jan 25, 2017, 1:32:02 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
d7feb86
Parents:
7cb7454f
git-author:
Sebastian Huber <sebastian.huber@…> (01/25/17 13:32:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/26/17 06:31:09)
Message:

score: Delete _CPU_Context_Fp_start()

Since the FP area pointer is passed by reference in
_CPU_Context_Initialize_fp() the optional FP area adjustment via
_CPU_Context_Fp_start() is superfluous. It is also wrong with respect
to memory management, e.g. pointer passed to _Workspace_Free() may be
not the one returned by _Workspace_Allocate().

Close #1400.

Location:
cpukit/score
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/arm/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    458458#define _CPU_Context_Restart_self( _the_context ) \
    459459   _CPU_Context_restore( (_the_context) );
    460 
    461 #define _CPU_Context_Fp_start( _base, _offset ) \
    462    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    463460
    464461#define _CPU_Context_Initialize_fp( _destination ) \
  • cpukit/score/cpu/bfin/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    735735   _CPU_Context_restore( (_the_context) );
    736736
    737 /**
    738  * @ingroup CPUContext
    739  * The purpose of this macro is to allow the initial pointer into
    740  * a floating point context area (used to save the floating point
    741  * context) to be at an arbitrary place in the floating point
    742  * context area.
    743  *
    744  * This is necessary because some FP units are designed to have
    745  * their context saved as a stack which grows into lower addresses.
    746  * Other FP units can be saved by simply moving registers into offsets
    747  * from the base of the context area.  Finally some FP units provide
    748  * a "dump context" instruction which could fill in from high to low
    749  * or low to high based on the whim of the CPU designers.
    750  *
    751  * @param[in] _base is the lowest physical address of the floating point
    752  *        context area
    753  * @param[in] _offset is the offset into the floating point area
    754  *
    755  * Port Specific Information:
    756  *
    757  * XXX document implementation including references if appropriate
    758  */
    759 #define _CPU_Context_Fp_start( _base, _offset ) \
    760    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    761 
    762737#define _CPU_Context_Initialize_fp( _destination ) \
    763738  memset( *( _destination ), 0, CPU_CONTEXT_FP_SIZE );
  • cpukit/score/cpu/epiphany/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    625625   _CPU_Context_restore( (_the_context) )
    626626
    627 /*
    628  *  The purpose of this macro is to allow the initial pointer into
    629  *  a floating point context area (used to save the floating point
    630  *  context) to be at an arbitrary place in the floating point
    631  *  context area.
    632  *
    633  *  This is necessary because some FP units are designed to have
    634  *  their context saved as a stack which grows into lower addresses.
    635  *  Other FP units can be saved by simply moving registers into offsets
    636  *  from the base of the context area.  Finally some FP units provide
    637  *  a "dump context" instruction which could fill in from high to low
    638  *  or low to high based on the whim of the CPU designers.
    639  *
    640  */
    641 
    642 #define _CPU_Context_Fp_start( _base, _offset ) \
    643    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    644 
    645627#define _CPU_Context_Initialize_fp( _destination ) \
    646628  memset( *( _destination ), 0, CPU_CONTEXT_FP_SIZE );
  • cpukit/score/cpu/i386/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    509509#endif
    510510
    511 #define _CPU_Context_Fp_start( _base, _offset ) \
    512    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    513 
    514511#define _CPU_Context_Initialize_fp( _fp_area ) \
    515512  { \
  • cpukit/score/cpu/lm32/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    750750
    751751/**
    752  * @ingroup CPUContext
    753  * The purpose of this macro is to allow the initial pointer into
    754  * a floating point context area (used to save the floating point
    755  * context) to be at an arbitrary place in the floating point
    756  * context area.
    757  *
    758  * This is necessary because some FP units are designed to have
    759  * their context saved as a stack which grows into lower addresses.
    760  * Other FP units can be saved by simply moving registers into offsets
    761  * from the base of the context area.  Finally some FP units provide
    762  * a "dump context" instruction which could fill in from high to low
    763  * or low to high based on the whim of the CPU designers.
    764  *
    765  * @param[in] _base is the lowest physical address of the floating point
    766  *        context area
    767  * @param[in] _offset is the offset into the floating point area
    768  *
    769  * Port Specific Information:
    770  *
    771  * XXX document implementation including references if appropriate
    772  */
    773 #define _CPU_Context_Fp_start( _base, _offset )
    774 #if 0
    775    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    776 #endif
    777 
    778 /**
    779752 * This routine initializes the FP context area passed to it to.
    780753 * There are a few standard ways in which to initialize the
  • cpukit/score/cpu/m32c/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    741741
    742742/**
    743  * @ingroup CPUContext
    744  *
    745  * The purpose of this macro is to allow the initial pointer into
    746  * a floating point context area (used to save the floating point
    747  * context) to be at an arbitrary place in the floating point
    748  * context area.
    749  *
    750  * This is necessary because some FP units are designed to have
    751  * their context saved as a stack which grows into lower addresses.
    752  * Other FP units can be saved by simply moving registers into offsets
    753  * from the base of the context area.  Finally some FP units provide
    754  * a "dump context" instruction which could fill in from high to low
    755  * or low to high based on the whim of the CPU designers.
    756  *
    757  * @param[in] _base is the lowest physical address of the floating point
    758  *        context area
    759  * @param[in] _offset is the offset into the floating point area
    760  *
    761  * Port Specific Information:
    762  *
    763  * XXX document implementation including references if appropriate
    764  */
    765 #define _CPU_Context_Fp_start( _base, _offset ) \
    766    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    767 
    768 /**
    769743 * This routine initializes the FP context area passed to it to.
    770744 * There are a few standard ways in which to initialize the
  • cpukit/score/cpu/m68k/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    173173  } Context_Control_fp;
    174174
    175   /*
    176    *  This software FP implementation is only for GCC.
    177    */
    178   #define _CPU_Context_Fp_start( _base, _offset ) \
    179      ((void *) _Addresses_Add_offset( (_base), (_offset) ) )
    180 
    181175  #define _CPU_Context_Initialize_fp( _fp_area ) \
    182176     { \
     
    234228      #endif
    235229    } Context_Control_fp;
    236 
    237     #define _CPU_Context_Fp_start( _base, _offset ) \
    238       ((void *) _Addresses_Add_offset( (_base), (_offset) ))
    239230
    240231    /*
     
    261252    } Context_Control_fp;
    262253
    263     #define _CPU_Context_Fp_start( _base, _offset ) \
    264        ( \
    265          (void *) _Addresses_Add_offset( \
    266             (_base), \
    267             (_offset) + CPU_CONTEXT_FP_SIZE - 4 \
    268          ) \
    269        )
    270 
     254    /*
     255     * The floating-point context is saved/restored via FSAVE/FRESTORE which
     256     * use a growing down stack.  Initialize the stack and adjust the FP area
     257     * pointer accordingly.
     258     */
    271259    #define _CPU_Context_Initialize_fp( _fp_area ) \
    272260       { \
    273          uint32_t   *_fp_context = (uint32_t *)*(_fp_area); \
     261         uint32_t *_fp_context = _Addresses_Add_offset( \
     262           *(_fp_area), CPU_CONTEXT_FP_SIZE - 4); \
    274263         *(--(_fp_context)) = 0; \
    275264         *(_fp_area) = (void *)(_fp_context); \
  • cpukit/score/cpu/mips/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    793793
    794794/*
    795  *  The purpose of this macro is to allow the initial pointer into
    796  *  A floating point context area (used to save the floating point
    797  *  context) to be at an arbitrary place in the floating point
    798  *  context area.
    799  *
    800  *  This is necessary because some FP units are designed to have
    801  *  their context saved as a stack which grows into lower addresses.
    802  *  Other FP units can be saved by simply moving registers into offsets
    803  *  from the base of the context area.  Finally some FP units provide
    804  *  a "dump context" instruction which could fill in from high to low
    805  *  or low to high based on the whim of the CPU designers.
    806  */
    807 
    808 #define _CPU_Context_Fp_start( _base, _offset ) \
    809    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    810 
    811 /*
    812795 *  This routine initializes the FP context area passed to it to.
    813796 *  There are a few standard ways in which to initialize the
  • cpukit/score/cpu/moxie/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    609609   _CPU_Context_restore( (_the_context) );
    610610
    611 /*
    612  *  The purpose of this macro is to allow the initial pointer into
    613  *  a floating point context area (used to save the floating point
    614  *  context) to be at an arbitrary place in the floating point
    615  *  context area.
    616  *
    617  *  This is necessary because some FP units are designed to have
    618  *  their context saved as a stack which grows into lower addresses.
    619  *  Other FP units can be saved by simply moving registers into offsets
    620  *  from the base of the context area.  Finally some FP units provide
    621  *  a "dump context" instruction which could fill in from high to low
    622  *  or low to high based on the whim of the CPU designers.
    623  *
    624  *  MOXIE Specific Information:
    625  *
    626  *  XXX
    627  */
    628 #define _CPU_Context_Fp_start( _base, _offset ) \
    629    ( (void *) (_base) + (_offset) )
    630 
    631611#define _CPU_Context_Initialize_fp( _destination ) \
    632612  memset( *( _destination ), 0, CPU_CONTEXT_FP_SIZE );
  • cpukit/score/cpu/no_cpu/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    877877
    878878/**
    879  * @ingroup CPUContext
    880  *
    881  * The purpose of this macro is to allow the initial pointer into
    882  * a floating point context area (used to save the floating point
    883  * context) to be at an arbitrary place in the floating point
    884  *context area.
    885  *
    886  * This is necessary because some FP units are designed to have
    887  * their context saved as a stack which grows into lower addresses.
    888  * Other FP units can be saved by simply moving registers into offsets
    889  * from the base of the context area.  Finally some FP units provide
    890  * a "dump context" instruction which could fill in from high to low
    891  * or low to high based on the whim of the CPU designers.
    892  *
    893  * @param[in] _base is the lowest physical address of the floating point
    894  *        context area
    895  * @param[in] _offset is the offset into the floating point area
    896  *
    897  * Port Specific Information:
    898  *
    899  * XXX document implementation including references if appropriate
    900  */
    901 #define _CPU_Context_Fp_start( _base, _offset ) \
    902    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    903 
    904 /**
    905879 * This routine initializes the FP context area passed to it to.
    906880 * There are a few standard ways in which to initialize the
  • cpukit/score/cpu/or1k/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    621621
    622622/*
    623  *  The purpose of this macro is to allow the initial pointer into
    624  *  a floating point context area (used to save the floating point
    625  *  context) to be at an arbitrary place in the floating point
    626  *  context area.
     623 *  This routine is responsible to initialize the FP context.
     624 *
     625 *  The FP area pointer is passed by reference to allow the initial pointer
     626 *  into a floating point context area (used to save the floating point
     627 *  context) to be at an arbitrary place in the floating point context area.
    627628 *
    628629 *  This is necessary because some FP units are designed to have
     
    632633 *  a "dump context" instruction which could fill in from high to low
    633634 *  or low to high based on the whim of the CPU designers.
    634  *
    635  */
    636 
    637 #define _CPU_Context_Fp_start( _base, _offset ) \
    638    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    639 
    640 #define _CPU_Context_Initialize_fp( _destination ) \
    641   memset( *( _destination ), 0, CPU_CONTEXT_FP_SIZE );
     635 */
     636#define _CPU_Context_Initialize_fp( _fp_area_p ) \
     637  memset( *( _fp_area_p ), 0, CPU_CONTEXT_FP_SIZE )
    642638
    643639/* end of Context handler macros */
  • cpukit/score/cpu/powerpc/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    832832
    833833/*
    834  *  The purpose of this macro is to allow the initial pointer into
    835  *  a floating point context area (used to save the floating point
    836  *  context) to be at an arbitrary place in the floating point
    837  *  context area.
    838  *
    839  *  This is necessary because some FP units are designed to have
    840  *  their context saved as a stack which grows into lower addresses.
    841  *  Other FP units can be saved by simply moving registers into offsets
    842  *  from the base of the context area.  Finally some FP units provide
    843  *  a "dump context" instruction which could fill in from high to low
    844  *  or low to high based on the whim of the CPU designers.
    845  */
    846 
    847 #define _CPU_Context_Fp_start( _base, _offset ) \
    848    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    849 
    850 /*
    851834 *  This routine initializes the FP context area passed to it to.
    852835 *  There are a few standard ways in which to initialize the
  • cpukit/score/cpu/sh/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    549549#define _CPU_Context_Restart_self( _the_context ) \
    550550   _CPU_Context_restore( (_the_context) );
    551 
    552 /*
    553  *  The purpose of this macro is to allow the initial pointer into
    554  *  a floating point context area (used to save the floating point
    555  *  context) to be at an arbitrary place in the floating point
    556  *  context area.
    557  *
    558  *  This is necessary because some FP units are designed to have
    559  *  their context saved as a stack which grows into lower addresses.
    560  *  Other FP units can be saved by simply moving registers into offsets
    561  *  from the base of the context area.  Finally some FP units provide
    562  *  a "dump context" instruction which could fill in from high to low
    563  *  or low to high based on the whim of the CPU designers.
    564  */
    565 
    566 #define _CPU_Context_Fp_start( _base, _offset ) \
    567    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    568551
    569552/*
  • cpukit/score/cpu/sparc/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    957957
    958958/**
    959  * The FP context area for the SPARC is a simple structure and nothing
    960  * special is required to find the "starting load point"
    961  */
    962 #define _CPU_Context_Fp_start( _base, _offset ) \
    963    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    964 
    965 /**
    966959 * This routine initializes the FP context area passed to it to.
    967960 *
  • cpukit/score/cpu/sparc64/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    825825
    826826/*
    827  *  The FP context area for the SPARC is a simple structure and nothing
    828  *  special is required to find the "starting load point"
    829  */
    830 
    831 #define _CPU_Context_Fp_start( _base, _offset ) \
    832    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    833 
    834 /*
    835827 *  This routine initializes the FP context area passed to it to.
    836828 *
  • cpukit/score/cpu/v850/rtems/score/cpu.h

    r7cb7454f r27bfcd8  
    700700#if 0
    701701/**
    702  * @ingroup CPUContext
    703  * The purpose of this macro is to allow the initial pointer into
    704  * a floating point context area (used to save the floating point
    705  * context) to be at an arbitrary place in the floating point
    706  * context area.
    707  *
    708  * This is necessary because some FP units are designed to have
    709  * their context saved as a stack which grows into lower addresses.
    710  * Other FP units can be saved by simply moving registers into offsets
    711  * from the base of the context area.  Finally some FP units provide
    712  * a "dump context" instruction which could fill in from high to low
    713  * or low to high based on the whim of the CPU designers.
    714  *
    715  * @param[in] _base is the lowest physical address of the floating point
    716  *        context area
    717  * @param[in] _offset is the offset into the floating point area
    718  *
    719  * Port Specific Information:
    720  *
    721  * XXX document implementation including references if appropriate
    722  */
    723 #define _CPU_Context_Fp_start( _base, _offset ) \
    724    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
    725 #endif
    726 
    727 /* XXX this should be possible to remove */
    728 #if 0
    729 /**
    730702 * This routine initializes the FP context area passed to it to.
    731703 * There are a few standard ways in which to initialize the
  • cpukit/score/include/rtems/score/context.h

    r7cb7454f r27bfcd8  
    112112
    113113/**
    114  *  @brief Return starting address of floating point context.
    115  *
    116  *  This function returns the starting address of the floating
    117  *  point context save area.  It is assumed that the are reserved
    118  *  for the floating point save area is large enough.
    119  *
    120  *  @param[in] _base is lowest physical address of the floating point
    121  *         context save area.
    122  *  @param[in] _offset is the offset into the floating point area
    123  *
    124  *  @retval the initial FP context pointer
    125  */
    126 #define _Context_Fp_start( _base, _offset ) \
    127    _CPU_Context_Fp_start( (_base), (_offset) )
    128 
    129 /**
    130114 *  @brief Initialize floating point context area.
    131115 *
  • cpukit/score/src/threadinitialize.c

    r7cb7454f r27bfcd8  
    138138      if ( !fp_area )
    139139        goto failed;
    140       fp_area = _Context_Fp_start( fp_area, 0 );
    141140    }
    142141    the_thread->fp_context       = fp_area;
Note: See TracChangeset for help on using the changeset viewer.