diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-04 10:04:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-04 10:54:52 +0100 |
commit | e7ab43d46fe871db090f563072e7ca00049cb73e (patch) | |
tree | 8be1881941d995bdcf580531fe7842db3e6ddc70 /cpukit/score/include/rtems/score | |
parent | score: Provide inline variants for ISR lock ops (diff) | |
download | rtems-e7ab43d46fe871db090f563072e7ca00049cb73e.tar.bz2 |
score: Use non-inline thread queue lock ops
This reduces the code size and helps to reduce the amount of testing.
Hot paths can use the _Thread_queue_Queue_acquire_critical() and
_Thread_queue_Queue_release_critical() functions which are still inline.
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index f74436df21..e6c8f0576b 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -358,20 +358,21 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_release( _ISR_lock_ISR_enable( lock_context ); } +#if defined(RTEMS_SMP) +void _Thread_queue_Do_acquire_critical( + Thread_queue_Control *the_thread_queue, + ISR_lock_Context *lock_context +); +#else RTEMS_INLINE_ROUTINE void _Thread_queue_Do_acquire_critical( Thread_queue_Control *the_thread_queue, ISR_lock_Context *lock_context ) { - _Thread_queue_Queue_acquire_critical( - &the_thread_queue->Queue, - &the_thread_queue->Lock_stats, - lock_context - ); -#if defined(RTEMS_DEBUG) && defined(RTEMS_SMP) - the_thread_queue->owner = _SMP_Get_current_processor(); -#endif + (void) the_thread_queue; + (void) lock_context; } +#endif RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical( Thread_queue_Control *the_thread_queue, @@ -384,14 +385,21 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical( ); } +#if defined(RTEMS_SMP) +void _Thread_queue_Acquire( + Thread_queue_Control *the_thread_queue, + Thread_queue_Context *queue_context +); +#else RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire( Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context ) { + (void) the_thread_queue; _ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context ); - _Thread_queue_Acquire_critical( the_thread_queue, queue_context ); } +#endif #if defined(RTEMS_DEBUG) RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_lock_owner( @@ -406,22 +414,22 @@ RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_lock_owner( } #endif +#if defined(RTEMS_SMP) +void _Thread_queue_Do_release_critical( + Thread_queue_Control *the_thread_queue, + ISR_lock_Context *lock_context +); +#else RTEMS_INLINE_ROUTINE void _Thread_queue_Do_release_critical( Thread_queue_Control *the_thread_queue, ISR_lock_Context *lock_context ) { -#if defined(RTEMS_DEBUG) + (void) the_thread_queue; + (void) lock_context; _Assert( _Thread_queue_Is_lock_owner( the_thread_queue ) ); -#if defined(RTEMS_SMP) - the_thread_queue->owner = SMP_LOCK_NO_OWNER; -#endif -#endif - _Thread_queue_Queue_release_critical( - &the_thread_queue->Queue, - lock_context - ); } +#endif RTEMS_INLINE_ROUTINE void _Thread_queue_Release_critical( Thread_queue_Control *the_thread_queue, @@ -434,14 +442,22 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Release_critical( ); } +#if defined(RTEMS_SMP) +void _Thread_queue_Release( + Thread_queue_Control *the_thread_queue, + Thread_queue_Context *queue_context +); +#else RTEMS_INLINE_ROUTINE void _Thread_queue_Release( Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context ) { - _Thread_queue_Release_critical( the_thread_queue, queue_context ); + (void) the_thread_queue; + _Assert( _Thread_queue_Is_lock_owner( the_thread_queue ) ); _ISR_lock_ISR_enable( &queue_context->Lock_context.Lock_context ); } +#endif Thread_Control *_Thread_queue_Do_dequeue( Thread_queue_Control *the_thread_queue, |