source: rtems/cpukit/score/inline/rtems/score/coremsg.inl @ baff4da

4.104.114.84.95
Last change on this file since baff4da was baff4da, checked in by Joel Sherrill <joel.sherrill@…>, on 11/01/04 at 13:22:41

2004-11-01 Joel Sherrill <joel@…>

  • score/cpu/no_cpu/rtems/score/cpu.h, score/include/rtems/debug.h, score/include/rtems/seterr.h, score/include/rtems/system.h, score/include/rtems/score/address.h, score/include/rtems/score/apiext.h, score/include/rtems/score/apimutex.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/chain.h, score/include/rtems/score/context.h, score/include/rtems/score/copyrt.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h, score/include/rtems/score/heap.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/priority.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/sysstate.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadmp.h, score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/userext.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/chain.inl, score/inline/rtems/score/coremsg.inl, score/inline/rtems/score/coremutex.inl, score/inline/rtems/score/coresem.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl, score/inline/rtems/score/mppkt.inl, score/inline/rtems/score/objectmp.inl, score/inline/rtems/score/priority.inl, score/inline/rtems/score/stack.inl, score/inline/rtems/score/states.inl, score/inline/rtems/score/sysstate.inl, score/inline/rtems/score/thread.inl, score/inline/rtems/score/threadmp.inl, score/inline/rtems/score/tod.inl, score/inline/rtems/score/tqdata.inl, score/inline/rtems/score/userext.inl, score/inline/rtems/score/watchdog.inl, score/inline/rtems/score/wkspace.inl: Add Doxygen comments -- working modifications which are not complete and may have broken code. Committing so work and testing can proceed.
  • score/Doxyfile, score/mainpage.h: New files.
  • Property mode set to 100644
File size: 5.6 KB
Line 
1/**
2 *  @file coremsg.inl
3 *
4 *  This include file contains the static inline implementation of all
5 *  inlined routines in the Core Message Handler.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2004.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef __CORE_MESSAGE_QUEUE_inl
20#define __CORE_MESSAGE_QUEUE_inl
21
22/**
23 *  @addtogroup ScoreMessageQueue
24 *  @{
25 */
26
27#include <string.h>   /* needed for memcpy */
28 
29/**
30 *  This routine sends a message to the end of the specified message queue.
31 */
32 
33RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
34  CORE_message_queue_Control                *the_message_queue,
35  void                                      *buffer,
36  uint32_t                                   size,
37  Objects_Id                                 id,
38  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support,
39  boolean                                    wait,
40  Watchdog_Interval                          timeout
41)
42{
43  return _CORE_message_queue_Submit(
44    the_message_queue,
45    buffer,
46    size,
47    id,
48#if defined(RTEMS_MULTIPROCESSING)
49    api_message_queue_mp_support,
50#else
51    NULL,
52#endif
53    CORE_MESSAGE_QUEUE_SEND_REQUEST,
54    wait,     /* sender may block */
55    timeout   /* timeout interval */
56  );
57}
58 
59/**
60 *  This routine sends a message to the front of the specified message queue.
61 */
62 
63RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
64  CORE_message_queue_Control                *the_message_queue,
65  void                                      *buffer,
66  uint32_t                                   size,
67  Objects_Id                                 id,
68  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support,
69  boolean                                    wait,
70  Watchdog_Interval                          timeout
71)
72{
73  return _CORE_message_queue_Submit(
74    the_message_queue,
75    buffer,
76    size,
77    id,
78#if defined(RTEMS_MULTIPROCESSING)
79    api_message_queue_mp_support,
80#else
81    NULL,
82#endif
83    CORE_MESSAGE_QUEUE_URGENT_REQUEST,
84    wait,     /* sender may block */
85    timeout   /* timeout interval */
86 );
87}
88
89/**
90 *  This routine copies the contents of the source message buffer
91 *  to the destination message buffer.
92 */
93
94RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
95  void      *source,
96  void      *destination,
97  uint32_t   size
98)
99{
100  memcpy(destination, source, size);
101}
102
103/**
104 *  This function allocates a message buffer from the inactive
105 *  message buffer chain.
106 */
107
108RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
109_CORE_message_queue_Allocate_message_buffer (
110    CORE_message_queue_Control *the_message_queue
111)
112{
113   return (CORE_message_queue_Buffer_control *)
114     _Chain_Get( &the_message_queue->Inactive_messages );
115}
116
117/**
118 *  This routine frees a message buffer to the inactive
119 *  message buffer chain.
120 */
121
122RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
123    CORE_message_queue_Control        *the_message_queue,
124    CORE_message_queue_Buffer_control *the_message
125)
126{
127  _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
128}
129
130/**
131 *  This function removes the first message from the_message_queue
132 *  and returns a pointer to it.
133 */
134
135RTEMS_INLINE_ROUTINE
136  CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
137  CORE_message_queue_Control *the_message_queue
138)
139{
140  return (CORE_message_queue_Buffer_control *)
141    _Chain_Get_unprotected( &the_message_queue->Pending_messages );
142}
143
144/**
145 *  This function returns TRUE if the priority attribute is
146 *  enabled in the attribute_set and FALSE otherwise.
147 */
148 
149RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_priority(
150  CORE_message_queue_Attributes *the_attribute
151)
152{
153  return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
154}
155
156/**
157 *  This routine places the_message at the rear of the outstanding
158 *  messages on the_message_queue.
159 */
160
161RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (
162  CORE_message_queue_Control        *the_message_queue,
163  CORE_message_queue_Buffer_control *the_message
164)
165{
166  _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
167}
168
169/**
170 *  This routine places the_message at the front of the outstanding
171 *  messages on the_message_queue.
172 */
173
174RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (
175  CORE_message_queue_Control        *the_message_queue,
176  CORE_message_queue_Buffer_control *the_message
177)
178{
179  _Chain_Prepend(
180    &the_message_queue->Pending_messages,
181    &the_message->Node
182  );
183}
184
185/**
186 *  This function returns TRUE if the_message_queue is TRUE and FALSE otherwise.
187 */
188
189RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_null (
190  CORE_message_queue_Control *the_message_queue
191)
192{
193  return ( the_message_queue == NULL  );
194}
195
196/**
197 *  This function returns TRUE if notification is enabled on this message
198 *  queue and FALSE otherwise.
199 */
200 
201RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_notify_enabled (
202  CORE_message_queue_Control *the_message_queue
203)
204{
205  return (the_message_queue->notify_handler != NULL);
206}
207 
208/**
209 *  This routine initializes the notification information for the_message_queue.
210 */
211 
212RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
213  CORE_message_queue_Control        *the_message_queue,
214  CORE_message_queue_Notify_Handler  the_handler,
215  void                              *the_argument
216)
217{
218  the_message_queue->notify_handler  = the_handler;
219  the_message_queue->notify_argument = the_argument;
220}
221
222/**@}*/
223
224#endif
225/* end of include file */
Note: See TracBrowser for help on using the repository browser.