diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-30 11:39:58 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-06 09:08:20 +0200 |
commit | 9809d6e08264525ea58839b98e6d90121b841196 (patch) | |
tree | 7ccbdd61436c18d1e1bae9033a3907afb5bff629 /cpukit/score/include/rtems/score | |
parent | score: Fix _Thread_queue_Extract_locked() (diff) | |
download | rtems-9809d6e08264525ea58839b98e6d90121b841196.tar.bz2 |
score: _Thread_queue_Flush() parameter changes
Change _Thread_queue_Flush() into a macro that invokes
_Thread_queue_Do_flush() with the parameter set defined by
RTEMS_MULTIPROCESSING. For multiprocessing configurations add the
object identifier to avoid direct use of the thread wait information.
Use mp_ prefix for multiprocessing related parameters.
Rename Thread_queue_Flush_callout to Thread_queue_MP_callout since this
type will be re-used later for other operations as well.
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r-- | cpukit/score/include/rtems/score/corebarrierimpl.h | 24 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremsgimpl.h | 45 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremuteximpl.h | 31 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/corerwlockimpl.h | 16 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coresemimpl.h | 42 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 81 |
6 files changed, 138 insertions, 101 deletions
diff --git a/cpukit/score/include/rtems/score/corebarrierimpl.h b/cpukit/score/include/rtems/score/corebarrierimpl.h index 87ea545747..7e1c0ab31a 100644 --- a/cpukit/score/include/rtems/score/corebarrierimpl.h +++ b/cpukit/score/include/rtems/score/corebarrierimpl.h @@ -140,21 +140,19 @@ uint32_t _CORE_barrier_Release( CORE_barrier_API_mp_support_callout api_barrier_mp_support ); -/** - * This routine assists in the deletion of a barrier by flushing the - * associated wait queue. - * - * @param[in] _the_barrier is the barrier to flush - * @param[in] _remote_extract_callout is the routine to invoke if the - * thread unblocked is remote - * @param[in] _status is the status to be returned to the unblocked thread - */ -#define _CORE_barrier_Flush( _the_barrier, _remote_extract_callout, _status) \ +/* Must be a macro due to the multiprocessing dependent parameters */ +#define _CORE_barrier_Flush( \ + the_barrier, \ + status, \ + mp_callout, \ + mp_id \ +) \ _Thread_queue_Flush( \ - &((_the_barrier)->Wait_queue), \ + &( the_barrier )->Wait_queue, \ CORE_BARRIER_TQ_OPERATIONS, \ - (_remote_extract_callout), \ - (_status) \ + status, \ + mp_callout, \ + mp_id \ ) /** diff --git a/cpukit/score/include/rtems/score/coremsgimpl.h b/cpukit/score/include/rtems/score/coremsgimpl.h index 407d3aee15..5b7abb2594 100644 --- a/cpukit/score/include/rtems/score/coremsgimpl.h +++ b/cpukit/score/include/rtems/score/coremsgimpl.h @@ -139,6 +139,16 @@ bool _CORE_message_queue_Initialize( size_t maximum_message_size ); +void _CORE_message_queue_Do_close( + CORE_message_queue_Control *the_message_queue, + uint32_t status +#if defined(RTEMS_MULTIPROCESSING) + , + Thread_queue_MP_callout mp_callout, + Objects_Id mp_id +#endif +); + /** * @brief Close a message queue. * @@ -150,16 +160,37 @@ bool _CORE_message_queue_Initialize( * flushing @a the_message_queue's task wait queue. * * @param[in] the_message_queue points to the message queue to close - * @param[in] remote_extract_callout is the routine to call for each thread - * that is extracted from the set of waiting threads * @param[in] status is the status that each waiting thread will return * from it's blocking service + * @param[in] mp_callout is the routine to call for each thread + * that is extracted from the set of waiting threads + * @param[in] mp_id the object identifier of the message queue object */ -void _CORE_message_queue_Close( - CORE_message_queue_Control *the_message_queue, - Thread_queue_Flush_callout remote_extract_callout, - uint32_t status -); +#if defined(RTEMS_MULTIPROCESSING) + #define _CORE_message_queue_Close( \ + the_message_queue, \ + status, \ + mp_callout, \ + mp_id \ + ) \ + _CORE_message_queue_Do_close( \ + the_message_queue, \ + status, \ + mp_callout, \ + mp_id \ + ) +#else + #define _CORE_message_queue_Close( \ + the_message_queue, \ + status, \ + mp_callout, \ + mp_id \ + ) \ + _CORE_message_queue_Do_close( \ + the_message_queue, \ + status \ + ) +#endif /** * @brief Flush pending messages. diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index a1cbb17734..812b6ba9cb 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -324,23 +324,20 @@ CORE_mutex_Status _CORE_mutex_Surrender( ISR_lock_Context *lock_context ); -/** - * @brief Flush all waiting threads. - * - * This routine assists in the deletion of a mutex by flushing the associated - * wait queue. - * - * @param[in] the_mutex is the mutex to flush - * @param[in] remote_extract_callout is the routine to invoke when a remote - * thread is extracted - * @param[in] status is the status value which each unblocked thread will - * return to its caller. - */ -void _CORE_mutex_Flush( - CORE_mutex_Control *the_mutex, - Thread_queue_Flush_callout remote_extract_callout, - uint32_t status -); +/* Must be a macro due to the multiprocessing dependent parameters */ +#define _CORE_mutex_Flush( \ + the_mutex, \ + status, \ + mp_callout, \ + mp_id \ +) \ + _Thread_queue_Flush( \ + &( the_mutex )->Wait_queue, \ + ( the_mutex )->operations, \ + status, \ + mp_callout, \ + mp_id \ + ) /** * @brief Is mutex locked. diff --git a/cpukit/score/include/rtems/score/corerwlockimpl.h b/cpukit/score/include/rtems/score/corerwlockimpl.h index 6d563a56cc..b9803c43c5 100644 --- a/cpukit/score/include/rtems/score/corerwlockimpl.h +++ b/cpukit/score/include/rtems/score/corerwlockimpl.h @@ -143,22 +143,6 @@ CORE_RWLock_Status _CORE_RWLock_Release( ); /** - * This routine assists in the deletion of a RWLock by flushing the - * associated wait queue. - * - * @param[in] _the_rwlock is the RWLock to flush - * @param[in] _remote_extract_callout is the routine to invoke if the - * thread unblocked is remote - * @param[in] _status is the status to be returned to the unblocked thread - */ -#define _CORE_RWLock_Flush( _the_rwlock, _remote_extract_callout, _status) \ - _Thread_queue_Flush( \ - &((_the_rwlock)->Wait_queue), \ - (_remote_extract_callout), \ - (_status) \ - ) - -/** * This method is used to initialize core rwlock attributes. * * @param[in] the_attributes pointer to the attributes to initialize. diff --git a/cpukit/score/include/rtems/score/coresemimpl.h b/cpukit/score/include/rtems/score/coresemimpl.h index 46033a8499..bde3e5b493 100644 --- a/cpukit/score/include/rtems/score/coresemimpl.h +++ b/cpukit/score/include/rtems/score/coresemimpl.h @@ -167,34 +167,20 @@ RTEMS_INLINE_ROUTINE CORE_semaphore_Status _CORE_semaphore_Surrender( return status; } -/** - * @brief Core semaphore flush. - * - * This package is the implementation of the CORE Semaphore Handler. - * This core object utilizes standard Dijkstra counting semaphores to provide - * synchronization and mutual exclusion capabilities. - * - * This routine assists in the deletion of a semaphore by flushing the - * associated wait queue. - * - * @param[in] the_semaphore is the semaphore to flush - * @param[in] remote_extract_callout is the routine to invoke if the - * thread unblocked is remote - * @param[in] status is the status to be returned to the unblocked thread - */ -RTEMS_INLINE_ROUTINE void _CORE_semaphore_Flush( - CORE_semaphore_Control *the_semaphore, - Thread_queue_Flush_callout remote_extract_callout, - uint32_t status -) -{ - _Thread_queue_Flush( - &the_semaphore->Wait_queue, - the_semaphore->operations, - remote_extract_callout, - status - ); -} +/* Must be a macro due to the multiprocessing dependent parameters */ +#define _CORE_semaphore_Flush( \ + the_semaphore, \ + status, \ + mp_callout, \ + mp_id \ +) \ + _Thread_queue_Flush( \ + &( the_semaphore )->Wait_queue, \ + ( the_semaphore )->operations, \ + status, \ + mp_callout, \ + mp_id \ + ) /** * This routine returns the current count associated with the semaphore. diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index 82f7dc1796..76f29d37f6 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -153,13 +153,20 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Release( ); } +#if defined(RTEMS_MULTIPROCESSING) /** - * The following type defines the callout used when a remote task - * is extracted from a local thread queue. + * @brief Multiprocessing (MP) support callout for thread queue operations. + * + * @param the_proxy The thread proxy of the thread queue operation. A thread + * control is actually a thread proxy if and only if + * _Objects_Is_local_id( the_proxy->Object.id ) is false. + * @param mp_id Object identifier of the object containing the thread queue. */ -typedef void ( *Thread_queue_Flush_callout )( - Thread_Control * - ); +typedef void ( *Thread_queue_MP_callout )( + Thread_Control *the_proxy, + Objects_Id mp_id +); +#endif /** * @brief Gets a pointer to a thread waiting on the_thread_queue. @@ -439,26 +446,60 @@ Thread_Control *_Thread_queue_First( const Thread_queue_Operations *operations ); -/** - * @brief Unblocks all threads blocked on the_thread_queue. - * - * This routine unblocks all threads blocked on the_thread_queue - * and cancels any associated timeouts. - * - * @param[in] the_thread_queue is the pointer to a threadq header - * @param[in] operations The thread queue operations. - * @param[in] remote_extract_callout points to a method to invoke to - * invoke when a remote thread is unblocked - * @param[in] status is the status which will be returned to - * all unblocked threads - */ -void _Thread_queue_Flush( +void _Thread_queue_Do_flush( Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations, - Thread_queue_Flush_callout remote_extract_callout, uint32_t status +#if defined(RTEMS_MULTIPROCESSING) + , + Thread_queue_MP_callout mp_callout, + Objects_Id mp_id +#endif ); +/** + * @brief Unblocks all threads blocked on the thread queue. + * + * The thread timers of the threads are cancelled. + * + * @param the_thread_queue The thread queue. + * @param operations The thread queue operations. + * @param status The return status for the threads. + * @param mp_callout Callout to extract the proxy of a remote thread. This + * parameter is only used on multiprocessing configurations. + * @param mp_id Object identifier of the object containing the thread queue. + * This parameter is only used on multiprocessing configurations. + */ +#if defined(RTEMS_MULTIPROCESSING) + #define _Thread_queue_Flush( \ + the_thread_queue, \ + operations, \ + status, \ + mp_callout, \ + mp_id \ + ) \ + _Thread_queue_Do_flush( \ + the_thread_queue, \ + operations, \ + status, \ + mp_callout, \ + mp_id \ + ) +#else + #define _Thread_queue_Flush( \ + the_thread_queue, \ + operations, \ + status, \ + mp_callout, \ + mp_id \ + ) \ + _Thread_queue_Do_flush( \ + the_thread_queue, \ + operations, \ + status \ + ) +#endif + void _Thread_queue_Initialize( Thread_queue_Control *the_thread_queue ); #if defined(RTEMS_SMP) && defined(RTEMS_PROFILING) |