score: Delete post-switch API extensions

Use thread post-switch actions instead.
This commit is contained in:
Sebastian Huber
2014-03-31 08:29:43 +02:00
parent fc521e2df6
commit 8061f568de
3 changed files with 0 additions and 76 deletions
-64
View File
@@ -51,13 +51,6 @@ extern "C" {
*/
typedef void (*API_extensions_Postdriver_hook)(void);
/**
* This type defines the prototype of the Post Switch Hook.
*/
typedef void (*API_extensions_Post_switch_hook)(
Thread_Control *
);
/**
* The control structure which defines the points at which an API
* can add an extension to the system initialization thread.
@@ -85,32 +78,11 @@ typedef struct {
API_extensions_Postdriver_hook postdriver_hook;
} API_extensions_Control;
/**
* @brief Control structure for post switch hooks.
*/
typedef struct {
Chain_Node Node;
/**
* @brief The hook invoked during each context switch in the context of the
* heir thread.
*
* This hook must not be NULL.
*/
API_extensions_Post_switch_hook hook;
} API_extensions_Post_switch_control;
/**
* This is the list of API extensions to the system initialization.
*/
SCORE_EXTERN Chain_Control _API_extensions_List;
/**
* @brief The API extensions post switch list.
*/
SCORE_EXTERN Chain_Control _API_extensions_Post_switch_list;
/**
* @brief Initialize the API extensions handler.
*
@@ -129,23 +101,6 @@ void _API_extensions_Add(
API_extensions_Control *the_extension
);
/**
* @brief Adds the API extension post switch control to the post switch list.
*
* The post switch control is only added to the list if it is in the off chain
* state. Thus this function can be called multiple times with the same
* post switch control and only the first invocation will actually add it to the
* list.
*
* There is no protection against concurrent access. This function must be
* called within a _Thread_Disable_dispatch() critical section.
*
* @param [in, out] post_switch The post switch control.
*/
void _API_extensions_Add_post_switch(
API_extensions_Post_switch_control *post_switch
);
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
/**
* @brief Execute all pre-driver extensions.
@@ -162,25 +117,6 @@ void _API_extensions_Add_post_switch(
*/
void _API_extensions_Run_postdriver( void );
/**
* @brief Runs all API extension post switch hooks.
*/
static inline void _API_extensions_Run_post_switch( Thread_Control *executing )
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
node = _Chain_Immutable_next( node );
}
}
/**@}*/
#ifdef __cplusplus
-11
View File
@@ -25,7 +25,6 @@
void _API_extensions_Initialization( void )
{
_Chain_Initialize_empty( &_API_extensions_List );
_Chain_Initialize_empty( &_API_extensions_Post_switch_list );
}
void _API_extensions_Add(
@@ -35,16 +34,6 @@ void _API_extensions_Add(
_Chain_Append( &_API_extensions_List, &the_extension->Node );
}
void _API_extensions_Add_post_switch(
API_extensions_Post_switch_control *post_switch
)
{
_Chain_Append_if_is_off_chain_unprotected(
&_API_extensions_Post_switch_list,
&post_switch->Node
);
}
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
void _API_extensions_Run_predriver( void )
-1
View File
@@ -207,6 +207,5 @@ post_switch:
_Per_CPU_Release_and_ISR_enable( per_cpu, level );
_API_extensions_Run_post_switch( executing );
_Thread_Run_post_switch_actions( executing );
}