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/rtems/src/semflush.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/rtems/src/semflush.c')
-rw-r--r-- | cpukit/rtems/src/semflush.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cpukit/rtems/src/semflush.c b/cpukit/rtems/src/semflush.c index 73e9ad06cb..b18de6d4a7 100644 --- a/cpukit/rtems/src/semflush.c +++ b/cpukit/rtems/src/semflush.c @@ -23,11 +23,15 @@ rtems_status_code rtems_semaphore_flush( rtems_id id ) { - Semaphore_Control *the_semaphore; - ISR_lock_Context lock_context; - rtems_attribute attribute_set; + Semaphore_Control *the_semaphore; + Thread_queue_Context queue_context; + rtems_attribute attribute_set; - the_semaphore = _Semaphore_Get( id, &lock_context ); + the_semaphore = _Semaphore_Get( + id, + &queue_context, + _Semaphore_MP_Send_object_was_deleted + ); if ( the_semaphore == NULL ) { #if defined(RTEMS_MULTIPROCESSING) @@ -43,30 +47,28 @@ rtems_status_code rtems_semaphore_flush( rtems_id id ) #if defined(RTEMS_SMP) if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) { - _ISR_lock_ISR_enable( &lock_context ); + _ISR_lock_ISR_enable( &queue_context.Lock_context ); return RTEMS_NOT_DEFINED; } else #endif if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) { _CORE_mutex_Acquire_critical( &the_semaphore->Core_control.mutex, - &lock_context + &queue_context ); _CORE_mutex_Flush( &the_semaphore->Core_control.mutex, _CORE_mutex_Unsatisfied_nowait, - _Semaphore_MP_Send_object_was_deleted, - &lock_context + &queue_context ); } else { _CORE_semaphore_Acquire_critical( &the_semaphore->Core_control.semaphore, - &lock_context + &queue_context ); _CORE_semaphore_Flush( &the_semaphore->Core_control.semaphore, - _Semaphore_MP_Send_object_was_deleted, - &lock_context + &queue_context ); } return RTEMS_SUCCESSFUL; |