diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-13 16:05:14 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-13 16:05:14 +0000 |
commit | 939ba8162fd32d4ce918b0b994adda8511641364 (patch) | |
tree | 850dfd391ca0c39c2a7f6acfecea52001474e7fd /cpukit/score/src/coremsginsert.c | |
parent | Don't cvsignore rtems*.spec. (diff) | |
download | rtems-939ba8162fd32d4ce918b0b994adda8511641364.tar.bz2 |
2009-09-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/inline/rtems/score/coremsg.inl, score/src/coremsg.c,
score/src/coremsgbroadcast.c, score/src/coremsginsert.c,
score/src/coremsgseize.c, score/src/coremsgsubmit.c: Add wrappers for
accessing message priority. Since these are empty when priority-based
message queues are disabled, this eliminates some of the
conditionals.
Diffstat (limited to 'cpukit/score/src/coremsginsert.c')
-rw-r--r-- | cpukit/score/src/coremsginsert.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/score/src/coremsginsert.c b/cpukit/score/src/coremsginsert.c index 9b5dbdfeef..686118bb23 100644 --- a/cpukit/score/src/coremsginsert.c +++ b/cpukit/score/src/coremsginsert.c @@ -65,9 +65,7 @@ void _CORE_message_queue_Insert_message( #define SET_NOTIFY() #endif - #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) - the_message->priority = submit_type; - #endif + _CORE_message_queue_Set_message_priority( the_message, submit_type ); #if !defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) _ISR_Disable( level ); @@ -95,14 +93,19 @@ void _CORE_message_queue_Insert_message( CORE_message_queue_Buffer_control *this_message; Chain_Node *the_node; Chain_Control *the_header; + int the_priority; + the_priority = _CORE_message_queue_Get_message_priority(the_message); the_header = &the_message_queue->Pending_messages; the_node = the_header->first; while ( !_Chain_Is_tail( the_header, the_node ) ) { + int this_priority; this_message = (CORE_message_queue_Buffer_control *) the_node; - if ( this_message->priority <= the_message->priority ) { + this_priority = _CORE_message_queue_Get_message_priority(this_message); + + if ( this_priority <= the_priority ) { the_node = the_node->next; continue; } |