diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-23 11:40:18 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-25 12:43:54 +0200 |
commit | 631b3c8967a329cdd53e54365e4e4c0aa93a4251 (patch) | |
tree | 3a750b145a90c90aa86222c26ee68aeb8c87a417 /cpukit/score/src/threadqflush.c | |
parent | score: Get rid of mp_id parameter (diff) | |
download | rtems-631b3c8967a329cdd53e54365e4e4c0aa93a4251.tar.bz2 |
score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods. Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.
Diffstat (limited to 'cpukit/score/src/threadqflush.c')
-rw-r--r-- | cpukit/score/src/threadqflush.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c index 0413388f5d..8b23194357 100644 --- a/cpukit/score/src/threadqflush.c +++ b/cpukit/score/src/threadqflush.c @@ -21,24 +21,21 @@ #include <rtems/score/threadimpl.h> Thread_Control *_Thread_queue_Flush_default_filter( - Thread_Control *the_thread, - Thread_queue_Queue *queue, - ISR_lock_Context *lock_context + Thread_Control *the_thread, + Thread_queue_Queue *queue, + Thread_queue_Context *queue_context ) { (void) queue; - (void) lock_context; + (void) queue_context; return the_thread; } -size_t _Thread_queue_Do_flush_critical( +size_t _Thread_queue_Flush_critical( Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_queue_Flush_filter filter, -#if defined(RTEMS_MULTIPROCESSING) - Thread_queue_MP_callout mp_callout, -#endif - ISR_lock_Context *lock_context + Thread_queue_Context *queue_context ) { size_t flushed; @@ -60,7 +57,7 @@ size_t _Thread_queue_Do_flush_critical( } first = ( *operations->first )( heads ); - first = ( *filter )( first, queue, lock_context ); + first = ( *filter )( first, queue, queue_context ); if ( first == NULL ) { break; } @@ -69,7 +66,7 @@ size_t _Thread_queue_Do_flush_critical( queue, operations, first, - mp_callout + queue_context ); if ( do_unblock ) { _Chain_Append_unprotected( &unblock, &first->Wait.Node.Chain ); @@ -84,8 +81,10 @@ size_t _Thread_queue_Do_flush_critical( if ( node != tail ) { Per_CPU_Control *cpu_self; - cpu_self = _Thread_Dispatch_disable_critical( lock_context ); - _Thread_queue_Queue_release( queue, lock_context ); + cpu_self = _Thread_Dispatch_disable_critical( + &queue_context->Lock_context + ); + _Thread_queue_Queue_release( queue, &queue_context->Lock_context ); do { Thread_Control *the_thread; @@ -100,7 +99,7 @@ size_t _Thread_queue_Do_flush_critical( _Thread_Dispatch_enable( cpu_self ); } else { - _Thread_queue_Queue_release( queue, lock_context ); + _Thread_queue_Queue_release( queue, &queue_context->Lock_context ); } return flushed; |