From df55d07f2e5c4b1c3d73c4f26a2cbb82f2af261c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 10 Dec 2015 14:10:48 +0100 Subject: score: Untangle thread actions Remove the thread action handler parameter from _Thread_Action_initialize() and instead set it later in _Thread_Add_post_switch_action(). This avoids a dependency on the thread action handler via the thread initialization. --- cpukit/score/include/rtems/score/threadimpl.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cpukit/score/include/rtems/score/threadimpl.h') diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index cf32082340..c61dd89f12 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -847,11 +847,9 @@ RTEMS_INLINE_ROUTINE void _Thread_Action_control_initialize( } RTEMS_INLINE_ROUTINE void _Thread_Action_initialize( - Thread_Action *action, - Thread_Action_handler handler + Thread_Action *action ) { - action->handler = handler; _Chain_Set_off_chain( &action->Node ); } @@ -890,8 +888,9 @@ RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( } RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action( - Thread_Control *thread, - Thread_Action *action + Thread_Control *thread, + Thread_Action *action, + Thread_Action_handler handler ) { Per_CPU_Control *cpu_of_thread; @@ -899,6 +898,8 @@ RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action( cpu_of_thread = _Thread_Action_ISR_disable_and_acquire( thread, &level ); + action->handler = handler; + #if defined(RTEMS_SMP) if ( _Per_CPU_Get() == cpu_of_thread ) { cpu_of_thread->dispatch_necessary = true; -- cgit v1.2.3