forked from Imagelibrary/rtems
2001-04-11 Joel Sherrill <joel@OARcorp.com>
* 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.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2001-04-11 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
|
||||
* 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.
|
||||
|
||||
2002-04-08 Chris Johns <ccj@acm.org>
|
||||
|
||||
* Per PR141 and PR174, make task switch extension its own list and
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine is used to add a user extension set to the active list.
|
||||
*
|
||||
* NOTE: Must be before _User_extensions_Handler_initialization to
|
||||
* ensure proper inlining.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
|
||||
|
||||
@@ -16,6 +16,33 @@
|
||||
#ifndef __USER_EXTENSIONS_inl
|
||||
#define __USER_EXTENSIONS_inl
|
||||
|
||||
#include <rtems/score/wkspace.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Add_set
|
||||
*
|
||||
* NOTE: Must be before _User_extensions_Handler_initialization to
|
||||
* ensure proper inlining.
|
||||
*/
|
||||
|
||||
#define _User_extensions_Add_set( _the_extension, _extension_table ) \
|
||||
do { \
|
||||
(_the_extension)->Callouts = *(_extension_table); \
|
||||
\
|
||||
_Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
|
||||
\
|
||||
if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
|
||||
(_the_extension)->Switch.thread_switch = \
|
||||
(_the_extension)->Callouts.thread_switch; \
|
||||
_Chain_Append( \
|
||||
&_User_extensions_Switches_list, \
|
||||
&(_the_extension)->Switch.Node \
|
||||
); \
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Handler_initialization
|
||||
@@ -49,28 +76,6 @@
|
||||
} \
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Add_set
|
||||
*/
|
||||
|
||||
#define _User_extensions_Add_set( _the_extension, _extension_table ) \
|
||||
do { \
|
||||
(_the_extension)->Callouts = *(_extension_table); \
|
||||
\
|
||||
_Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node ); \
|
||||
\
|
||||
if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
|
||||
(_the_extension)->Switch.thread_switch = \
|
||||
(_the_extension)->Callouts.thread_switch; \
|
||||
_Chain_Append( \
|
||||
&_User_extensions_Switches_list, \
|
||||
&(_the_extension)->Switch.Node \
|
||||
); \
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Add_API_set
|
||||
@@ -78,7 +83,7 @@
|
||||
|
||||
#define _User_extensions_Add_API_set( _the_extension ) \
|
||||
do { \
|
||||
_Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node ); \
|
||||
_Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
|
||||
\
|
||||
if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
|
||||
(_the_extension)->Switch.thread_switch = \
|
||||
@@ -88,7 +93,6 @@
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Remove_set
|
||||
@@ -103,56 +107,6 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Run_list_forward
|
||||
*
|
||||
* NOTE: No parentheses around macro names here to avoid
|
||||
* messing up the name and function call expansion.
|
||||
*/
|
||||
|
||||
#define _User_extensions_Run_list_forward( _list, _name, _arguments ) \
|
||||
do { \
|
||||
Chain_Node *the_node; \
|
||||
User_extensions_Control *the_extension; \
|
||||
\
|
||||
for ( the_node = (_list).first ; \
|
||||
!_Chain_Is_tail( &(_list), the_node ) ; \
|
||||
the_node = the_node->next ) { \
|
||||
the_extension = (User_extensions_Control *) the_node; \
|
||||
\
|
||||
if ( the_extension->Callouts.## _name != NULL ) \
|
||||
(*the_extension->Callouts.## _name) _arguments; \
|
||||
\
|
||||
} \
|
||||
\
|
||||
} while ( 0 )
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Run_list_backward
|
||||
*
|
||||
* NOTE: No parentheses around macro names here to avoid
|
||||
* messing up the name and function call expansion.
|
||||
*/
|
||||
|
||||
#define _User_extensions_Run_list_backward( _list, _name, _arguments ) \
|
||||
do { \
|
||||
Chain_Node *the_node; \
|
||||
User_extensions_Control *the_extension; \
|
||||
\
|
||||
for ( the_node = (_list).last ; \
|
||||
!_Chain_Is_head( &(_list), the_node ) ; \
|
||||
the_node = the_node->previous ) { \
|
||||
the_extension = (User_extensions_Control *) the_node; \
|
||||
\
|
||||
if ( the_extension->Callouts.## _name != NULL ) \
|
||||
(*the_extension->Callouts.## _name) _arguments; \
|
||||
\
|
||||
} \
|
||||
\
|
||||
} while ( 0 )
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Thread_switch
|
||||
@@ -160,11 +114,19 @@
|
||||
*/
|
||||
|
||||
#define _User_extensions_Thread_switch( _executing, _heir ) \
|
||||
_User_extensions_Run_list_forward( \
|
||||
_User_extensions_Switches_list, \
|
||||
thread_switch, \
|
||||
(_executing, _heir) \
|
||||
)
|
||||
do { \
|
||||
Chain_Node *the_node; \
|
||||
User_extensions_Switch_control *the_extension_switch; \
|
||||
\
|
||||
for ( the_node = _User_extensions_Switches_list.first ; \
|
||||
!_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; \
|
||||
the_node = the_node->next ) { \
|
||||
\
|
||||
the_extension_switch = (User_extensions_Switch_control *) the_node; \
|
||||
\
|
||||
(*the_extension_switch->thread_switch)( _executing, _heir ); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
Reference in New Issue
Block a user