forked from Imagelibrary/rtems
score: Inline _API_extensions_Run_postswitch()
The _API_extensions_Run_postswitch() function is only used in _Thread_Dispatch(). Avoid superfluous load of _Thread_Executing.
This commit is contained in:
@@ -130,7 +130,21 @@ void _API_extensions_Run_postdriver( void );
|
||||
*
|
||||
* This routine executes all of the post context switch callouts.
|
||||
*/
|
||||
void _API_extensions_Run_postswitch( void );
|
||||
static inline void _API_extensions_Run_postswitch( Thread_Control *executing )
|
||||
{
|
||||
const Chain_Control *chain = &_API_extensions_List;
|
||||
const Chain_Node *tail = _Chain_Immutable_tail( chain );
|
||||
const Chain_Node *node = _Chain_Immutable_first( chain );
|
||||
|
||||
while ( node != tail ) {
|
||||
const API_extensions_Control *extension =
|
||||
(const API_extensions_Control *) node;
|
||||
|
||||
(*extension->postswitch_hook)( executing );
|
||||
|
||||
node = _Chain_Immutable_next( node );
|
||||
}
|
||||
}
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
@@ -84,23 +84,4 @@ void _API_extensions_Run_postdriver( void )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* _API_extensions_Run_postswitch
|
||||
*/
|
||||
|
||||
void _API_extensions_Run_postswitch( void )
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
API_extensions_Control *the_extension;
|
||||
|
||||
for ( the_node = _Chain_First( &_API_extensions_List );
|
||||
!_Chain_Is_tail( &_API_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
the_extension = (API_extensions_Control *) the_node;
|
||||
|
||||
(*the_extension->postswitch_hook)( _Thread_Executing );
|
||||
}
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
|
||||
@@ -211,5 +211,5 @@ post_switch:
|
||||
_Thread_Unnest_dispatch();
|
||||
#endif
|
||||
|
||||
_API_extensions_Run_postswitch();
|
||||
_API_extensions_Run_postswitch( executing );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user