diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-27 13:26:53 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-30 16:16:21 +0200 |
commit | 0e1d11f3f0f02768ced350fcb53056c55f0c545b (patch) | |
tree | 1f7062ab130bf78d924a7e34eec62864f3d8ae6e /cpukit/score/src | |
parent | score: Adjust thread queue layout (diff) | |
download | rtems-0e1d11f3f0f02768ced350fcb53056c55f0c545b.tar.bz2 |
score: Add _Thread_queue_Context_set_MP_callout()
Add _Thread_queue_Context_set_MP_callout() to simplify
_Thread_queue_Context_initialize(). This makes it possible to more
easily add additional fields to Thread_queue_Context.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/apimutexlock.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/apimutexunlock.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/condition.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/mpci.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/mutex.c | 4 | ||||
-rw-r--r-- | cpukit/score/src/semaphore.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/threadqenqueue.c | 12 | ||||
-rw-r--r-- | cpukit/score/src/threadrestart.c | 2 |
8 files changed, 15 insertions, 13 deletions
diff --git a/cpukit/score/src/apimutexlock.c b/cpukit/score/src/apimutexlock.c index 11d12c5a7e..7a7f911f84 100644 --- a/cpukit/score/src/apimutexlock.c +++ b/cpukit/score/src/apimutexlock.c @@ -31,7 +31,7 @@ void _API_Mutex_Lock( API_Mutex_Control *the_mutex ) previous_thread_life_state = _Thread_Set_life_protection( THREAD_LIFE_PROTECTED ); - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); _ISR_lock_ISR_disable( &queue_context.Lock_context ); _CORE_mutex_Seize( diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c index f0f114e0bf..486301fa82 100644 --- a/cpukit/score/src/apimutexunlock.c +++ b/cpukit/score/src/apimutexunlock.c @@ -31,7 +31,7 @@ void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) previous_thread_life_state = the_mutex->previous_thread_life_state; restore_thread_life_protection = the_mutex->Mutex.nest_count == 1; - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); _ISR_lock_ISR_disable( &queue_context.Lock_context ); _CORE_mutex_Surrender( &the_mutex->Mutex, &queue_context ); diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c index 39924e8c92..fae150a7cd 100644 --- a/cpukit/score/src/condition.c +++ b/cpukit/score/src/condition.c @@ -247,7 +247,7 @@ static void _Condition_Wake( struct _Condition_Control *_condition, int count ) Condition_Context context; condition = _Condition_Get( _condition ); - _Thread_queue_Context_initialize( &context.Base, NULL ); + _Thread_queue_Context_initialize( &context.Base ); _ISR_lock_ISR_disable( &context.Base.Lock_context ); _Condition_Queue_acquire_critical( condition, &context.Base.Lock_context ); diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 78d8e657fa..1e26b1f3ce 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -325,7 +325,7 @@ void _MPCI_Receive_server( Thread_queue_Context queue_context; executing = _Thread_Get_executing(); - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); for ( ; ; ) { diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c index eea15a05dc..6a85850a89 100644 --- a/cpukit/score/src/mutex.c +++ b/cpukit/score/src/mutex.c @@ -293,7 +293,7 @@ void _Mutex_Release( struct _Mutex_Control *_mutex ) Thread_Control *executing; mutex = _Mutex_Get( _mutex ); - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); executing = _Mutex_Queue_acquire( mutex, &queue_context.Lock_context ); _Assert( mutex->Queue.Queue.owner == executing ); @@ -422,7 +422,7 @@ void _Mutex_recursive_Release( struct _Mutex_recursive_Control *_mutex ) unsigned int nest_level; mutex = _Mutex_recursive_Get( _mutex ); - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); executing = _Mutex_Queue_acquire( &mutex->Mutex, &queue_context.Lock_context diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c index ea0835d7b5..72abd9e12a 100644 --- a/cpukit/score/src/semaphore.c +++ b/cpukit/score/src/semaphore.c @@ -114,7 +114,7 @@ void _Semaphore_Post( struct _Semaphore_Control *_sem ) Thread_queue_Heads *heads; sem = _Semaphore_Get( _sem ); - _Thread_queue_Context_initialize( &queue_context, NULL ); + _Thread_queue_Context_initialize( &queue_context ); _Semaphore_Queue_acquire( sem, &queue_context.Lock_context ); heads = sem->Queue.Queue.heads; diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index 948275b74c..4eaafa9036 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -195,10 +195,7 @@ void _Thread_queue_Extract( Thread_Control *the_thread ) void *lock; Thread_queue_Queue *queue; - _Thread_queue_Context_initialize( - &queue_context, - _Thread_queue_MP_callout_do_nothing - ); + _Thread_queue_Context_initialize( &queue_context ); lock = _Thread_Lock_acquire( the_thread, &queue_context.Lock_context ); queue = the_thread->Wait.queue; @@ -206,6 +203,10 @@ void _Thread_queue_Extract( Thread_Control *the_thread ) if ( queue != NULL ) { _SMP_Assert( lock == &queue->Lock ); + _Thread_queue_Context_set_MP_callout( + &queue_context, + _Thread_queue_MP_callout_do_nothing + ); _Thread_queue_Extract_critical( queue, the_thread->Wait.operations, @@ -229,7 +230,8 @@ Thread_Control *_Thread_queue_Do_dequeue( Thread_queue_Context queue_context; Thread_Control *the_thread; - _Thread_queue_Context_initialize( &queue_context, mp_callout ); + _Thread_queue_Context_initialize( &queue_context ); + _Thread_queue_Context_set_MP_callout( &queue_context, mp_callout ); _Thread_queue_Acquire( the_thread_queue, &queue_context.Lock_context ); the_thread = _Thread_queue_First_locked( the_thread_queue, operations ); diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index f9636e61c7..3bddac458d 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -118,7 +118,7 @@ static void _Thread_Wake_up_joining_threads( Thread_Control *the_thread ) join_context.exit_value = the_thread->Life.exit_value; #endif - _Thread_queue_Context_initialize( &join_context.Base, NULL ); + _Thread_queue_Context_initialize( &join_context.Base ); _Thread_queue_Acquire( &the_thread->Join_queue, &join_context.Base.Lock_context |