diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-23 10:01:31 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-29 07:26:42 +0200 |
commit | 1e1a91ed11458ddbb27b94d0001d8f0fc2ef7a97 (patch) | |
tree | 5e7cb0e88da11528eb7fb4bae9148564c949d066 /cpukit/score/include/rtems/score/coresemimpl.h | |
parent | libcpu/m68k/mcf5272/clock/ckinit.c: Fix warning by including <rtems/clockdrv.h> (diff) | |
download | rtems-1e1a91ed11458ddbb27b94d0001d8f0fc2ef7a97.tar.bz2 |
score: Remove Thread_queue_Queue::operations field
Remove the Thread_queue_Queue::operations field to reduce the size of
this structure. Add a thread queue operations parameter to the
_Thread_queue_First(), _Thread_queue_First_locked(),
_Thread_queue_Enqueue(), _Thread_queue_Dequeue() and
_Thread_queue_Flush() functions. This is a preparation patch to reduce
the size of several synchronization objects.
Diffstat (limited to 'cpukit/score/include/rtems/score/coresemimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/coresemimpl.h | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/cpukit/score/include/rtems/score/coresemimpl.h b/cpukit/score/include/rtems/score/coresemimpl.h index a6a30bcc15..365345a219 100644 --- a/cpukit/score/include/rtems/score/coresemimpl.h +++ b/cpukit/score/include/rtems/score/coresemimpl.h @@ -86,13 +86,15 @@ typedef void ( *CORE_semaphore_API_mp_support_callout )( * This routine initializes the semaphore based on the parameters passed. * * @param[in] the_semaphore is the semaphore to initialize - * @param[in] the_semaphore_attributes define the behavior of this instance + * @param[in] discipline the blocking discipline + * @param[in] maximum_count the maximum count * @param[in] initial_value is the initial count of the semaphore */ void _CORE_semaphore_Initialize( - CORE_semaphore_Control *the_semaphore, - const CORE_semaphore_Attributes *the_semaphore_attributes, - uint32_t initial_value + CORE_semaphore_Control *the_semaphore, + CORE_semaphore_Disciplines discipline, + uint32_t maximum_count, + uint32_t initial_value ); RTEMS_INLINE_ROUTINE void _CORE_semaphore_Destroy( @@ -133,7 +135,10 @@ RTEMS_INLINE_ROUTINE CORE_semaphore_Status _CORE_semaphore_Surrender( _Thread_queue_Acquire_critical( &the_semaphore->Wait_queue, lock_context ); - the_thread = _Thread_queue_First_locked( &the_semaphore->Wait_queue ); + the_thread = _Thread_queue_First_locked( + &the_semaphore->Wait_queue, + the_semaphore->operations + ); if ( the_thread != NULL ) { #if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch_disable(); @@ -141,7 +146,7 @@ RTEMS_INLINE_ROUTINE CORE_semaphore_Status _CORE_semaphore_Surrender( _Thread_queue_Extract_critical( &the_semaphore->Wait_queue.Queue, - the_semaphore->Wait_queue.operations, + the_semaphore->operations, the_thread, lock_context ); @@ -187,27 +192,13 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Flush( { _Thread_queue_Flush( &the_semaphore->Wait_queue, + the_semaphore->operations, remote_extract_callout, status ); } /** - * This function returns true if the priority attribute is - * enabled in the @a attribute_set and false otherwise. - * - * @param[in] the_attribute is the attribute set to test - * - * @return true if the priority attribute is enabled - */ -RTEMS_INLINE_ROUTINE bool _CORE_semaphore_Is_priority( - const CORE_semaphore_Attributes *the_attribute -) -{ - return ( the_attribute->discipline == CORE_SEMAPHORE_DISCIPLINES_PRIORITY ); -} - -/** * This routine returns the current count associated with the semaphore. * * @param[in] the_semaphore is the semaphore to obtain the count of @@ -265,7 +256,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Seize( executing->Wait.id = id; _Thread_queue_Enqueue_critical( &the_semaphore->Wait_queue.Queue, - the_semaphore->Wait_queue.operations, + the_semaphore->operations, executing, STATES_WAITING_FOR_SEMAPHORE, timeout, |