[PATCH 06/19] score: _CORE_message_queue_Set_message_priority()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 29 09:13:06 UTC 2016


Remove _CORE_message_queue_Set_message_priority() and set the priority
in _CORE_message_queue_Insert_message().
---
 cpukit/score/include/rtems/score/coremsgimpl.h | 16 ----------------
 cpukit/score/src/coremsginsert.c               |  5 ++++-
 cpukit/score/src/coremsgseize.c                | 11 +++--------
 cpukit/score/src/coremsgsubmit.c               |  2 --
 4 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/cpukit/score/include/rtems/score/coremsgimpl.h b/cpukit/score/include/rtems/score/coremsgimpl.h
index b9e4be4..7edca17 100644
--- a/cpukit/score/include/rtems/score/coremsgimpl.h
+++ b/cpukit/score/include/rtems/score/coremsgimpl.h
@@ -580,22 +580,6 @@ RTEMS_INLINE_ROUTINE int _CORE_message_queue_Get_message_priority (
 }
 
 /**
- * This function sets the priority of @a the_message.
- *
- * @note It encapsulates the optional behavior that message priority is
- *       disabled if no API requires it.
- */
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_message_priority (
-  CORE_message_queue_Buffer_control *the_message,
-  int                                priority
-)
-{
-  #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
-    the_message->priority = priority;
-  #endif
-}
-
-/**
  * This function removes the first message from the_message_queue
  * and returns a pointer to it.
  */
diff --git a/cpukit/score/src/coremsginsert.c b/cpukit/score/src/coremsginsert.c
index 0a73af8..a58a451 100644
--- a/cpukit/score/src/coremsginsert.c
+++ b/cpukit/score/src/coremsginsert.c
@@ -48,7 +48,10 @@ void _CORE_message_queue_Insert_message(
   bool           notify;
 #endif
 
-  _CORE_message_queue_Set_message_priority( the_message, submit_type );
+#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
+  the_message->priority = submit_type;
+#endif
+
   pending_messages = &the_message_queue->Pending_messages;
 
 #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c
index 2471b91..4c318bc 100644
--- a/cpukit/score/src/coremsgseize.c
+++ b/cpukit/score/src/coremsgseize.c
@@ -90,21 +90,16 @@ void _CORE_message_queue_Seize(
        *  puts the messages in the message queue on behalf of the
        *  waiting task.
        */
-      _CORE_message_queue_Set_message_priority(
-        the_message,
-        the_thread->Wait.count
-      );
       the_message->Contents.size = (size_t) the_thread->Wait.option;
       _CORE_message_queue_Copy_buffer(
         the_thread->Wait.return_argument_second.immutable_object,
         the_message->Contents.buffer,
         the_message->Contents.size
       );
-
       _CORE_message_queue_Insert_message(
-         the_message_queue,
-         the_message,
-         _CORE_message_queue_Get_message_priority( the_message )
+        the_message_queue,
+        the_message,
+        the_thread->Wait.count
       );
       _Thread_queue_Extract_critical(
         &the_message_queue->Wait_queue.Queue,
diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c
index 61d1330..e899734 100644
--- a/cpukit/score/src/coremsgsubmit.c
+++ b/cpukit/score/src/coremsgsubmit.c
@@ -73,13 +73,11 @@ CORE_message_queue_Status _CORE_message_queue_Do_submit(
       _CORE_message_queue_Allocate_message_buffer( the_message_queue );
   if ( the_message ) {
     the_message->Contents.size = size;
-    _CORE_message_queue_Set_message_priority( the_message, submit_type );
     _CORE_message_queue_Copy_buffer(
       buffer,
       the_message->Contents.buffer,
       size
     );
-
     _CORE_message_queue_Insert_message(
        the_message_queue,
        the_message,
-- 
1.8.4.5




More information about the devel mailing list