[PATCH 07/17] score: Delete post-switch API extensions

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 25 12:49:11 UTC 2014


Use thread post-switch actions instead.
---
 cpukit/score/include/rtems/score/apiext.h |   64 -----------------------------
 cpukit/score/src/apiext.c                 |   11 -----
 cpukit/score/src/threaddispatch.c         |    1 -
 3 files changed, 0 insertions(+), 76 deletions(-)

diff --git a/cpukit/score/include/rtems/score/apiext.h b/cpukit/score/include/rtems/score/apiext.h
index f281ab8..8382673 100644
--- a/cpukit/score/include/rtems/score/apiext.h
+++ b/cpukit/score/include/rtems/score/apiext.h
@@ -52,13 +52,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.
  */
@@ -86,31 +79,10 @@ typedef struct {
 }  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
diff --git a/cpukit/score/src/apiext.c b/cpukit/score/src/apiext.c
index d4e67bf..3d9121d 100644
--- a/cpukit/score/src/apiext.c
+++ b/cpukit/score/src/apiext.c
@@ -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 )
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index ae30c0c..ae69a5c 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -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 );
 }
-- 
1.7.7




More information about the devel mailing list