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/rtems/src | |
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/rtems/src')
-rw-r--r-- | cpukit/rtems/src/msgqcreate.c | 8 | ||||
-rw-r--r-- | cpukit/rtems/src/regioncreate.c | 12 | ||||
-rw-r--r-- | cpukit/rtems/src/regiongetsegment.c | 1 | ||||
-rw-r--r-- | cpukit/rtems/src/regionprocessqueue.c | 5 | ||||
-rw-r--r-- | cpukit/rtems/src/semcreate.c | 14 |
5 files changed, 21 insertions, 19 deletions
diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c index b18f3b2591..8a16819f80 100644 --- a/cpukit/rtems/src/msgqcreate.c +++ b/cpukit/rtems/src/msgqcreate.c @@ -40,7 +40,7 @@ rtems_status_code rtems_message_queue_create( ) { Message_queue_Control *the_message_queue; - CORE_message_queue_Attributes the_msgq_attributes; + CORE_message_queue_Disciplines discipline; #if defined(RTEMS_MULTIPROCESSING) bool is_global; #endif @@ -101,13 +101,13 @@ rtems_status_code rtems_message_queue_create( the_message_queue->attribute_set = attribute_set; if (_Attributes_Is_priority( attribute_set ) ) - the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; + discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; else - the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; + discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; if ( ! _CORE_message_queue_Initialize( &the_message_queue->message_queue, - &the_msgq_attributes, + discipline, count, max_message_size ) ) { diff --git a/cpukit/rtems/src/regioncreate.c b/cpukit/rtems/src/regioncreate.c index 409510c892..482c43b4d3 100644 --- a/cpukit/rtems/src/regioncreate.c +++ b/cpukit/rtems/src/regioncreate.c @@ -71,11 +71,13 @@ rtems_status_code rtems_region_create( return_status = RTEMS_TOO_MANY; else { - _Thread_queue_Initialize( - &the_region->Wait_queue, - _Attributes_Is_priority( attribute_set ) ? - THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO - ); + _Thread_queue_Initialize( &the_region->Wait_queue ); + + if ( _Attributes_Is_priority( attribute_set ) ) { + the_region->wait_operations = &_Thread_queue_Operations_priority; + } else { + the_region->wait_operations = &_Thread_queue_Operations_FIFO; + } the_region->maximum_segment_size = _Heap_Initialize( &the_region->Memory, starting_address, length, page_size diff --git a/cpukit/rtems/src/regiongetsegment.c b/cpukit/rtems/src/regiongetsegment.c index 864bd00952..b040ebe2d3 100644 --- a/cpukit/rtems/src/regiongetsegment.c +++ b/cpukit/rtems/src/regiongetsegment.c @@ -81,6 +81,7 @@ rtems_status_code rtems_region_get_segment( _Thread_queue_Enqueue( &the_region->Wait_queue, + the_region->wait_operations, executing, STATES_WAITING_FOR_SEGMENT, timeout, diff --git a/cpukit/rtems/src/regionprocessqueue.c b/cpukit/rtems/src/regionprocessqueue.c index a06a077e3d..a1f2601c77 100644 --- a/cpukit/rtems/src/regionprocessqueue.c +++ b/cpukit/rtems/src/regionprocessqueue.c @@ -46,7 +46,10 @@ void _Region_Process_queue( * threads whose memory request is satisfied. */ for ( ; ; ) { - the_thread = _Thread_queue_First( &the_region->Wait_queue ); + the_thread = _Thread_queue_First( + &the_region->Wait_queue, + the_region->wait_operations + ); if ( the_thread == NULL ) break; diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c index 5e93e02632..c8111fd269 100644 --- a/cpukit/rtems/src/semcreate.c +++ b/cpukit/rtems/src/semcreate.c @@ -62,7 +62,7 @@ rtems_status_code rtems_semaphore_create( { Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; - CORE_semaphore_Attributes the_semaphore_attr; + CORE_semaphore_Disciplines semaphore_discipline; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) @@ -139,15 +139,10 @@ rtems_status_code rtems_semaphore_create( * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { - /* - * This effectively disables limit checking. - */ - the_semaphore_attr.maximum_count = 0xFFFFFFFF; - if ( _Attributes_Is_priority( attribute_set ) ) - the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; + semaphore_discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; else - the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; + semaphore_discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. @@ -157,7 +152,8 @@ rtems_status_code rtems_semaphore_create( _CORE_semaphore_Initialize( &the_semaphore->Core_control.semaphore, - &the_semaphore_attr, + semaphore_discipline, + 0xFFFFFFFF, count ); #if defined(RTEMS_SMP) |