Changeset aadb6b0 in rtems for cpukit/score


Ignore:
Timestamp:
Apr 8, 2002, 6:21:47 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
ab377aa
Parents:
e2c488a4
Message:

2001-04-08 Joel Sherrill <joel@…>

  • macros/rtems/score/userext.inl: Updated to reflect modifications to inline version from PR142.
  • inline/rtems/score/userext.inl: Cleanup as side-effect of above.
Location:
cpukit/score
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/ChangeLog

    re2c488a4 raadb6b0  
     12001-04-08      Joel Sherrill <joel@OARcorp.com>
     2
     3        * macros/rtems/score/userext.inl: Updated to reflect modifications
     4        to inline version from PR142.
     5        * inline/rtems/score/userext.inl: Cleanup as side-effect of above.
     6 
    172002-04-08      Chris Johns <ccj@acm.org>
    28
  • cpukit/score/inline/rtems/score/userext.inl

    re2c488a4 raadb6b0  
    4040   * If a switch handler is present, append it to the switch chain.
    4141   */
     42
    4243  if ( extension_table->thread_switch != NULL ) {
    4344    the_extension->Switch.thread_switch = extension_table->thread_switch;
     
    9899)
    99100{
    100   _User_extensions_Add_set( the_extension );
     101  _Chain_Append( &_User_extensions_List, &the_extension->Node );
     102
     103  /*
     104   *  If a switch handler is present, append it to the switch chain.
     105   */
     106
     107  if ( extension_table->thread_switch != NULL ) {
     108    _Chain_Append(
     109      &_User_extensions_Switches_list, &the_extension->Switch.Node );
     110  }
    101111}
    102112
  • cpukit/score/macros/rtems/score/userext.inl

    re2c488a4 raadb6b0  
    2424
    2525#define _User_extensions_Handler_initialization( \
    26   number_of_extensions, _initial_extensions \
     26  _number_of_extensions, _initial_extensions \
    2727) \
    2828  { \
    2929    User_extensions_Control *extension; \
    3030    unsigned32               i; \
     31    \
    3132    _Chain_Initialize_empty( &_User_extensions_List ); \
     33    _Chain_Initialize_empty( &_User_extensions_Switches_list ); \
    3234    \
    3335    if ( (_initial_extensions) ) { \
    34       for (i=0 ; i<number_of_extensions ; i++ ) { \
    35         extension = \
    36            _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) ); \
    37         \
    38         extension->Callouts = _initial_extensions[i]; \
    39         _Chain_Append( &_User_extensions_List, &extension->Node ); \
     36      extension = _Workspace_Allocate_or_fatal_error( \
     37          sizeof(User_extensions_Control) * _number_of_extensions ); \
     38      \
     39      memset ( \
     40        extension, \
     41        0, \
     42        _number_of_extensions * sizeof( User_extensions_Control ) \
     43      ); \
     44      \
     45      for ( i = 0 ; i < _number_of_extensions ; i++ ) { \
     46        _User_extensions_Add_set (extension, &_initial_extensions[i]); \
     47        extension++; \
    4048      } \
    4149    } \
     
    5159    (_the_extension)->Callouts = *(_extension_table); \
    5260    \
    53     _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
     61    _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node ); \
     62    \
     63    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
     64      (_the_extension)->Switch.thread_switch = \
     65        (_the_extension)->Callouts.thread_switch; \
     66      _Chain_Append( \
     67        &_User_extensions_Switches_list, \
     68        &(_the_extension)->Switch.Node \
     69     ); \
     70    } \
    5471  } while ( 0 )
     72 
    5573
    5674/*PAGE
     
    6078 
    6179#define _User_extensions_Add_API_set( _the_extension ) \
    62   _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
     80  do { \
     81    _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node ); \
     82    \
     83    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
     84      _Chain_Append( \
     85        &_User_extensions_Switches_list, &(_the_extension)->Switch.Node ); \
     86    } \
     87  } while ( 0 )
    6388 
    64 
     89 
    6590/*PAGE
    6691 *
     
    6994
    7095#define _User_extensions_Remove_set( _the_extension ) \
    71   _Chain_Extract( &(_the_extension)->Node )
     96  do { \
     97    _Chain_Extract( &(_the_extension)->Node ); \
     98    \
     99    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
     100      _Chain_Extract( &(_the_extension)->Node ); \
     101    } \
     102  } while (0)
    72103
    73104/*PAGE
     
    79110 */
    80111
    81 #define _User_extensions_Run_list_forward( _name, _arguments ) \
     112#define _User_extensions_Run_list_forward( _list, _name, _arguments ) \
    82113  do { \
    83114    Chain_Node              *the_node; \
    84115    User_extensions_Control *the_extension; \
    85116    \
    86     for ( the_node = _User_extensions_List.first ; \
    87           !_Chain_Is_tail( &_User_extensions_List, the_node ) ; \
     117    for ( the_node = (_list).first ; \
     118          !_Chain_Is_tail( &(_list), the_node ) ; \
    88119          the_node = the_node->next ) { \
    89120      the_extension = (User_extensions_Control *) the_node; \
     
    104135 */
    105136
    106 #define _User_extensions_Run_list_backward( _name, _arguments ) \
     137#define _User_extensions_Run_list_backward( _list, _name, _arguments ) \
    107138  do { \
    108139    Chain_Node              *the_node; \
    109140    User_extensions_Control *the_extension; \
    110141    \
    111     for ( the_node = _User_extensions_List.last ; \
    112           !_Chain_Is_head( &_User_extensions_List, the_node ) ; \
     142    for ( the_node = (_list).last ; \
     143          !_Chain_Is_head( &(_list), the_node ) ; \
    113144          the_node = the_node->previous ) { \
    114145      the_extension = (User_extensions_Control *) the_node; \
     
    128159
    129160#define _User_extensions_Thread_switch( _executing, _heir ) \
    130   _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
     161  _User_extensions_Run_list_forward( \
     162    _User_extensions_Switches_list, \
     163    thread_switch, \
     164    (_executing, _heir) \
     165  )
    131166
    132167#endif
Note: See TracChangeset for help on using the changeset viewer.