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/coremutexsurrender.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 '')
-rw-r--r-- | cpukit/score/src/coremutexsurrender.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c index 746fee118e..040a580592 100644 --- a/cpukit/score/src/coremutexsurrender.c +++ b/cpukit/score/src/coremutexsurrender.c @@ -23,12 +23,9 @@ #include <rtems/score/coremuteximpl.h> #include <rtems/score/thread.h> -CORE_mutex_Status _CORE_mutex_Do_surrender( - CORE_mutex_Control *the_mutex, -#if defined(RTEMS_MULTIPROCESSING) - Thread_queue_MP_callout mp_callout, -#endif - ISR_lock_Context *lock_context +CORE_mutex_Status _CORE_mutex_Surrender( + CORE_mutex_Control *the_mutex, + Thread_queue_Context *queue_context ) { Thread_Control *the_thread; @@ -46,17 +43,17 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( if ( the_mutex->Attributes.only_owner_release ) { if ( !_Thread_Is_executing( holder ) ) { - _ISR_lock_ISR_enable( lock_context ); + _ISR_lock_ISR_enable( &queue_context->Lock_context ); return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } } - _Thread_queue_Acquire_critical( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Acquire_critical( the_mutex, queue_context ); /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) { - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Release( the_mutex, queue_context ); return CORE_MUTEX_STATUS_SUCCESSFUL; } @@ -71,12 +68,12 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( #if defined(RTEMS_DEBUG) switch ( the_mutex->Attributes.lock_nesting_behavior ) { case CORE_MUTEX_NESTING_ACQUIRES: - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Release( the_mutex, queue_context ); return CORE_MUTEX_STATUS_SUCCESSFUL; #if defined(RTEMS_POSIX_API) case CORE_MUTEX_NESTING_IS_ERROR: /* should never occur */ - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Release( the_mutex, queue_context ); return CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; #endif case CORE_MUTEX_NESTING_BLOCKS: @@ -84,7 +81,7 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( break; } #else - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Release( the_mutex, queue_context ); /* must be CORE_MUTEX_NESTING_ACQUIRES or we wouldn't be here */ return CORE_MUTEX_STATUS_SUCCESSFUL; #endif @@ -126,7 +123,7 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( &the_mutex->Wait_queue.Queue, the_mutex->operations, the_thread, - mp_callout + queue_context ); #if defined(RTEMS_MULTIPROCESSING) @@ -155,10 +152,10 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( unblock, &the_mutex->Wait_queue.Queue, the_thread, - lock_context + &queue_context->Lock_context ); } else { - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); + _CORE_mutex_Release( the_mutex, queue_context ); } /* |