diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-13 07:04:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 07:49:38 +0200 |
commit | 938839077741d2eac82d9d86705c16e0b9de8379 (patch) | |
tree | cf426c86ed7751264c0ff3db600627cbbfda99ff /cpukit/score/include/rtems/score/threadimpl.h | |
parent | score: Add _Thread_Dispatch_disable_with_CPU() (diff) | |
download | rtems-938839077741d2eac82d9d86705c16e0b9de8379.tar.bz2 |
score: Split _Thread_Restart()
Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other(). Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant
lock for thread restart. _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().
Update #2555.
Update #2626.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 68b9e72295..e77352389c 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -190,10 +190,16 @@ bool _Thread_Start( const Thread_Entry_information *entry ); -bool _Thread_Restart( - Thread_Control *the_thread, +void _Thread_Restart_self( Thread_Control *executing, - const Thread_Entry_information *entry + const Thread_Entry_information *entry, + ISR_lock_Context *lock_context +) RTEMS_NO_RETURN; + +bool _Thread_Restart_other( + Thread_Control *the_thread, + const Thread_Entry_information *entry, + ISR_lock_Context *lock_context ); void _Thread_Yield( Thread_Control *executing ); @@ -687,30 +693,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Unblock ( } /** - * This routine resets the current context of the calling thread - * to that of its initial state. - */ - -RTEMS_INLINE_ROUTINE void _Thread_Restart_self( Thread_Control *executing ) -{ -#if defined(RTEMS_SMP) - ISR_Level level; - - _Giant_Release( _Per_CPU_Get() ); - - _ISR_Disable_without_giant( level ); - ( void ) level; -#endif - -#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) - if ( executing->fp_context != NULL ) - _Context_Restore_fp( &executing->fp_context ); -#endif - - _CPU_Context_Restart_self( &executing->Registers ); -} - -/** * This function returns true if the floating point context of * the_thread is currently loaded in the floating point unit, and * false otherwise. |