summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-13 16:05:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-13 16:05:14 +0000
commit939ba8162fd32d4ce918b0b994adda8511641364 (patch)
tree850dfd391ca0c39c2a7f6acfecea52001474e7fd /cpukit/score/inline/rtems
parentDon't cvsignore rtems*.spec. (diff)
downloadrtems-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 '')
-rw-r--r--cpukit/score/inline/rtems/score/coremsg.inl64
1 files changed, 48 insertions, 16 deletions
diff --git a/cpukit/score/inline/rtems/score/coremsg.inl b/cpukit/score/inline/rtems/score/coremsg.inl
index bd961b3957..dd53865aa7 100644
--- a/cpukit/score/inline/rtems/score/coremsg.inl
+++ b/cpukit/score/inline/rtems/score/coremsg.inl
@@ -119,14 +119,45 @@ _CORE_message_queue_Allocate_message_buffer (
* message buffer chain.
*/
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Buffer_control *the_message
+ CORE_message_queue_Control *the_message_queue,
+ CORE_message_queue_Buffer_control *the_message
)
{
_Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
}
/**
+ * This function returns 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 int _CORE_message_queue_Get_message_priority (
+ CORE_message_queue_Buffer_control *the_message
+)
+{
+ #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
+ return the_message->priority;
+ #else
+ return 0;
+ #endif
+}
+
+/**
+ * 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
+)
+{
+ the_message->priority = priority;
+}
+
+/**
* This function removes the first message from the_message_queue
* and returns a pointer to it.
*/
@@ -202,22 +233,23 @@ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_null (
{
return (the_message_queue->notify_handler != NULL);
}
+#endif
- /**
- * This routine initializes the notification information for
- * @a the_message_queue.
- */
-
- RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
- CORE_message_queue_Control *the_message_queue,
- CORE_message_queue_Notify_Handler the_handler,
- void *the_argument
- )
- {
- the_message_queue->notify_handler = the_handler;
- the_message_queue->notify_argument = the_argument;
- }
+/**
+ * This routine initializes the notification information for
+ * @a the_message_queue.
+ */
+RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
+ CORE_message_queue_Control *the_message_queue,
+ CORE_message_queue_Notify_Handler the_handler,
+ void *the_argument
+)
+{
+#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
+ the_message_queue->notify_handler = the_handler;
+ the_message_queue->notify_argument = the_argument;
#endif
+}
/**@}*/