diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-25 16:00:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-06 09:06:21 +0100 |
commit | 0c286e3d7c176a4fb7faf6ba9f809996d599ca10 (patch) | |
tree | bf30809e9a4f92d19254fa1acb1f833effa8dc40 /cpukit/score/src/coremsginsert.c | |
parent | score: Remove superfluous include (diff) | |
download | rtems-0c286e3d7c176a4fb7faf6ba9f809996d599ca10.tar.bz2 |
score: _Chain_Insert_ordered_unprotected()
Change the chain order relation to use a directly specified left hand
side value. This is similar to _RBTree_Insert_inline() and helps the
compiler to better optimize the code.
Diffstat (limited to 'cpukit/score/src/coremsginsert.c')
-rw-r--r-- | cpukit/score/src/coremsginsert.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/score/src/coremsginsert.c b/cpukit/score/src/coremsginsert.c index 4613f50436..a9aa1e584e 100644 --- a/cpukit/score/src/coremsginsert.c +++ b/cpukit/score/src/coremsginsert.c @@ -22,17 +22,17 @@ #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) static bool _CORE_message_queue_Order( - const Chain_Node *left, + const void *left, const Chain_Node *right ) { - const CORE_message_queue_Buffer_control *left_message; + const int *left_priority; const CORE_message_queue_Buffer_control *right_message; - left_message = (const CORE_message_queue_Buffer_control *) left; + left_priority = (const int *) left; right_message = (const CORE_message_queue_Buffer_control *) right; - return _CORE_message_queue_Get_message_priority( left_message ) < + return *left_priority < _CORE_message_queue_Get_message_priority( right_message ); } #endif @@ -66,9 +66,13 @@ void _CORE_message_queue_Insert_message( _Chain_Append_unprotected( pending_messages, &the_message->Node ); #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) } else if ( submit_type != CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { + int priority; + + priority = _CORE_message_queue_Get_message_priority( the_message ); _Chain_Insert_ordered_unprotected( pending_messages, &the_message->Node, + &priority, _CORE_message_queue_Order ); #endif |