Changeset ed11413b in rtems for cpukit/score


Ignore:
Timestamp:
Apr 11, 2002, 1:51:06 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
5ad4692
Parents:
6568b90
Message:

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

  • macros/rtems/score/userext.inl: Now works after merging patch for functionality requested in PR174.
  • inline/rtems/score/userext.inl: Added a comment explaining the order in which routines appear since it is not the obvious order.
Location:
cpukit/score
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/ChangeLog

    r6568b90 red11413b  
     12001-04-11      Joel Sherrill <joel@OARcorp.com>
     2
     3       
     4        * macros/rtems/score/userext.inl: Now works after merging patch for
     5        functionality requested in PR174.
     6        * inline/rtems/score/userext.inl: Added a comment explaining the
     7        order in which routines appear since it is not the obvious order.
     8 
    192002-04-08      Chris Johns <ccj@acm.org>
    210
  • cpukit/score/inline/rtems/score/userext.inl

    r6568b90 red11413b  
    2626 *
    2727 *  This routine is used to add a user extension set to the active list.
     28 *
     29 *  NOTE: Must be before _User_extensions_Handler_initialization to
     30 *        ensure proper inlining.
    2831 */
    2932
  • cpukit/score/macros/rtems/score/userext.inl

    r6568b90 red11413b  
    1616#ifndef __USER_EXTENSIONS_inl
    1717#define __USER_EXTENSIONS_inl
     18
     19#include <rtems/score/wkspace.h>
     20
     21/*PAGE
     22 *
     23 *  _User_extensions_Add_set
     24 *
     25 *  NOTE: Must be before _User_extensions_Handler_initialization to
     26 *        ensure proper inlining.
     27 */
     28 
     29#define _User_extensions_Add_set( _the_extension, _extension_table ) \
     30  do { \
     31    (_the_extension)->Callouts = *(_extension_table); \
     32    \
     33    _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
     34    \
     35    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
     36      (_the_extension)->Switch.thread_switch = \
     37        (_the_extension)->Callouts.thread_switch; \
     38      _Chain_Append( \
     39        &_User_extensions_Switches_list, \
     40        &(_the_extension)->Switch.Node \
     41     ); \
     42    } \
     43  } while ( 0 )
     44 
    1845
    1946/*PAGE
     
    5279/*PAGE
    5380 *
    54  *  _User_extensions_Add_set
    55  */
    56 
    57 #define _User_extensions_Add_set( _the_extension, _extension_table ) \
    58   do { \
    59     (_the_extension)->Callouts = *(_extension_table); \
    60     \
    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     } \
    71   } while ( 0 )
    72  
    73 
    74 /*PAGE
    75  *
    7681 *  _User_extensions_Add_API_set
    7782 */
     
    7984#define _User_extensions_Add_API_set( _the_extension ) \
    8085  do { \
    81     _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node ); \
     86    _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
    8287    \
    8388    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
     
    8893    } \
    8994  } while ( 0 )
    90  
    9195 
    9296/*PAGE
     
    106110/*PAGE
    107111 *
    108  *  _User_extensions_Run_list_forward
    109  *
    110  *  NOTE:  No parentheses around macro names here to avoid
    111  *         messing up the name and function call expansion.
    112  */
    113 
    114 #define _User_extensions_Run_list_forward( _list, _name, _arguments ) \
    115   do { \
    116     Chain_Node              *the_node; \
    117     User_extensions_Control *the_extension; \
    118     \
    119     for ( the_node = (_list).first ; \
    120           !_Chain_Is_tail( &(_list), the_node ) ; \
    121           the_node = the_node->next ) { \
    122       the_extension = (User_extensions_Control *) the_node; \
    123       \
    124       if ( the_extension->Callouts.## _name != NULL ) \
    125         (*the_extension->Callouts.## _name) _arguments; \
    126       \
    127     } \
    128     \
    129   } while ( 0 )
    130 
    131 /*PAGE
    132  *
    133  *  _User_extensions_Run_list_backward
    134  *
    135  *  NOTE:  No parentheses around macro names here to avoid
    136  *         messing up the name and function call expansion.
    137  */
    138 
    139 #define _User_extensions_Run_list_backward( _list, _name, _arguments ) \
    140   do { \
    141     Chain_Node              *the_node; \
    142     User_extensions_Control *the_extension; \
    143     \
    144     for ( the_node = (_list).last ; \
    145           !_Chain_Is_head( &(_list), the_node ) ; \
    146           the_node = the_node->previous ) { \
    147       the_extension = (User_extensions_Control *) the_node; \
    148       \
    149       if ( the_extension->Callouts.## _name != NULL ) \
    150         (*the_extension->Callouts.## _name) _arguments; \
    151       \
    152     } \
    153     \
    154   } while ( 0 )
    155 
    156 /*PAGE
    157  *
    158112 *  _User_extensions_Thread_switch
    159113 *
     
    161115
    162116#define _User_extensions_Thread_switch( _executing, _heir ) \
    163   _User_extensions_Run_list_forward( \
    164     _User_extensions_Switches_list, \
    165     thread_switch, \
    166     (_executing, _heir) \
    167   )
     117  do { \
     118    Chain_Node                     *the_node; \
     119    User_extensions_Switch_control *the_extension_switch; \
     120    \
     121    for ( the_node = _User_extensions_Switches_list.first ; \
     122          !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; \
     123          the_node = the_node->next ) { \
     124      \
     125      the_extension_switch = (User_extensions_Switch_control *) the_node; \
     126      \
     127      (*the_extension_switch->thread_switch)( _executing, _heir ); \
     128    } \
     129  } while (0)
    168130
    169131#endif
Note: See TracChangeset for help on using the changeset viewer.