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:
Sebastian Huber
2012-11-22 13:03:09 +01:00
parent 32b2c83d00
commit 74d22fd1a9
3 changed files with 16 additions and 21 deletions

View File

@@ -130,7 +130,21 @@ void _API_extensions_Run_postdriver( void );
* *
* This routine executes all of the post context switch callouts. * 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 );
}
}
/**@}*/ /**@}*/

View File

@@ -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 */ /* end of file */

View File

@@ -211,5 +211,5 @@ post_switch:
_Thread_Unnest_dispatch(); _Thread_Unnest_dispatch();
#endif #endif
_API_extensions_Run_postswitch(); _API_extensions_Run_postswitch( executing );
} }