From 631b3c8967a329cdd53e54365e4e4c0aa93a4251 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 May 2016 11:40:18 +0200 Subject: 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. --- cpukit/score/include/rtems/score/corebarrierimpl.h | 150 ++++++--------------- 1 file changed, 44 insertions(+), 106 deletions(-) (limited to 'cpukit/score/include/rtems/score/corebarrierimpl.h') diff --git a/cpukit/score/include/rtems/score/corebarrierimpl.h b/cpukit/score/include/rtems/score/corebarrierimpl.h index d5133cd1cf..051990e818 100644 --- a/cpukit/score/include/rtems/score/corebarrierimpl.h +++ b/cpukit/score/include/rtems/score/corebarrierimpl.h @@ -84,31 +84,26 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy( RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical( CORE_barrier_Control *the_barrier, - ISR_lock_Context *lock_context + Thread_queue_Context *queue_context ) { - _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, lock_context ); + _Thread_queue_Acquire_critical( + &the_barrier->Wait_queue, + &queue_context->Lock_context + ); } RTEMS_INLINE_ROUTINE void _CORE_barrier_Release( CORE_barrier_Control *the_barrier, - ISR_lock_Context *lock_context + Thread_queue_Context *queue_context ) { - _Thread_queue_Release( &the_barrier->Wait_queue, lock_context ); + _Thread_queue_Release( + &the_barrier->Wait_queue, + &queue_context->Lock_context + ); } -void _CORE_barrier_Do_seize( - CORE_barrier_Control *the_barrier, - Thread_Control *executing, - bool wait, - Watchdog_Interval timeout, -#if defined(RTEMS_MULTIPROCESSING) - Thread_queue_MP_callout mp_callout, -#endif - ISR_lock_Context *lock_context -); - /** * @brief Wait for the barrier. * @@ -127,48 +122,18 @@ void _CORE_barrier_Do_seize( * * @note Status is returned via the thread control block. */ -#if defined(RTEMS_MULTIPROCESSING) - #define _CORE_barrier_Seize( \ - the_barrier, \ - executing, \ - wait, \ - timeout, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_seize( \ - the_barrier, \ - executing, \ - wait, \ - timeout, \ - mp_callout, \ - lock_context \ - ) -#else - #define _CORE_barrier_Seize( \ - the_barrier, \ - executing, \ - wait, \ - timeout, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_seize( \ - the_barrier, \ - executing, \ - wait, \ - timeout, \ - lock_context \ - ) -#endif +void _CORE_barrier_Seize( + CORE_barrier_Control *the_barrier, + Thread_Control *executing, + bool wait, + Watchdog_Interval timeout, + Thread_queue_Context *queue_context +); -uint32_t _CORE_barrier_Do_surrender( +uint32_t _CORE_barrier_Do_flush( CORE_barrier_Control *the_barrier, 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 ); /** @@ -183,62 +148,35 @@ uint32_t _CORE_barrier_Do_surrender( * * @retval the number of unblocked threads */ -#if defined(RTEMS_MULTIPROCESSING) - #define _CORE_barrier_Surrender( \ - the_barrier, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_surrender( \ - the_barrier, \ - _Thread_queue_Flush_default_filter, \ - mp_callout, \ - lock_context \ - ) -#else - #define _CORE_barrier_Surrender( \ - the_barrier, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_surrender( \ - the_barrier, \ - _Thread_queue_Flush_default_filter, \ - lock_context \ - ) -#endif +RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender( + CORE_barrier_Control *the_barrier, + Thread_queue_Context *queue_context +) +{ + return _CORE_barrier_Do_flush( + the_barrier, + _Thread_queue_Flush_default_filter, + queue_context + ); +} Thread_Control *_CORE_barrier_Was_deleted( - 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 ); -/* Must be a macro due to the multiprocessing dependent parameters */ -#if defined(RTEMS_MULTIPROCESSING) - #define _CORE_barrier_Flush( \ - the_barrier, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_surrender( \ - the_barrier, \ - _CORE_barrier_Was_deleted, \ - mp_callout, \ - lock_context \ - ) -#else - #define _CORE_barrier_Flush( \ - the_barrier, \ - mp_callout, \ - lock_context \ - ) \ - _CORE_barrier_Do_surrender( \ - the_barrier, \ - _CORE_barrier_Was_deleted, \ - lock_context \ - ) -#endif +RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush( + CORE_barrier_Control *the_barrier, + Thread_queue_Context *queue_context +) +{ + _CORE_barrier_Do_flush( + the_barrier, + _CORE_barrier_Was_deleted, + queue_context + ); +} /** * This function returns true if the automatic release attribute is -- cgit v1.2.3