summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/apiext.c21
-rw-r--r--cpukit/score/src/thread.c7
2 files changed, 27 insertions, 1 deletions
diff --git a/cpukit/score/src/apiext.c b/cpukit/score/src/apiext.c
index 68d80bed07..6e82b49a53 100644
--- a/cpukit/score/src/apiext.c
+++ b/cpukit/score/src/apiext.c
@@ -81,4 +81,25 @@ void _API_extensions_Run_postdriver( void )
}
}
+/*PAGE
+ *
+ * _API_extensions_Run_postswitch
+ */
+
+void _API_extensions_Run_postswitch( void )
+{
+ Chain_Node *the_node;
+ API_extensions_Control *the_extension;
+
+ for ( the_node = _API_extensions_List.first ;
+ !_Chain_Is_tail( &_API_extensions_List, the_node ) ;
+ the_node = the_node->next ) {
+
+ the_extension = (API_extensions_Control *) the_node;
+
+ if ( the_extension->postswitch_hook )
+ (*the_extension->postswitch_hook)( _Thread_Executing );
+ }
+}
+
/* end of file */
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
index b44da17c67..7cda6e5108 100644
--- a/cpukit/score/src/thread.c
+++ b/cpukit/score/src/thread.c
@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
+#include <rtems/score/apiext.h>
#include <rtems/score/context.h>
#include <rtems/score/interr.h>
#include <rtems/score/isr.h>
@@ -200,7 +201,10 @@ void _Thread_Dispatch( void )
_ISR_Enable( level );
- _User_extensions_Thread_post_switch( executing );
+ if ( executing->do_post_task_switch_extension ) {
+ executing->do_post_task_switch_extension = FALSE;
+ _API_extensions_Run_postswitch();
+ }
}
@@ -813,6 +817,7 @@ void _Thread_Load_environment(
is_fp = TRUE;
}
+ the_thread->do_post_task_switch_extension = FALSE;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
the_thread->is_timeslice = the_thread->Start.is_timeslice;