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

4.104.114.84.95
Last change on this file since dd687d97 was dd687d97, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:56:05

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems/debug.h, include/rtems/seterr.h, include/rtems/system.h, include/rtems/score/address.h, include/rtems/score/apiext.h, include/rtems/score/apimutex.h, include/rtems/score/bitfield.h, include/rtems/score/chain.h, include/rtems/score/context.h, include/rtems/score/copyrt.h, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/heap.h, include/rtems/score/interr.h, include/rtems/score/isr.h, include/rtems/score/mpci.h, include/rtems/score/mppkt.h, include/rtems/score/object.h, include/rtems/score/objectmp.h, include/rtems/score/priority.h, include/rtems/score/stack.h, include/rtems/score/states.h, include/rtems/score/sysstate.h, include/rtems/score/thread.h, include/rtems/score/threadmp.h, include/rtems/score/threadq.h, include/rtems/score/tod.h, include/rtems/score/tqdata.h, include/rtems/score/userext.h, include/rtems/score/watchdog.h, include/rtems/score/wkspace.h, inline/rtems/score/address.inl, inline/rtems/score/chain.inl, inline/rtems/score/coremsg.inl, inline/rtems/score/coremutex.inl, inline/rtems/score/coresem.inl, inline/rtems/score/heap.inl, inline/rtems/score/isr.inl, inline/rtems/score/mppkt.inl, inline/rtems/score/object.inl, inline/rtems/score/objectmp.inl, inline/rtems/score/priority.inl, inline/rtems/score/stack.inl, inline/rtems/score/states.inl, inline/rtems/score/sysstate.inl, inline/rtems/score/thread.inl, inline/rtems/score/threadmp.inl, inline/rtems/score/tod.inl, inline/rtems/score/tqdata.inl, inline/rtems/score/userext.inl, inline/rtems/score/watchdog.inl, inline/rtems/score/wkspace.inl, macros/rtems/score/address.inl, macros/rtems/score/chain.inl, macros/rtems/score/coremsg.inl, macros/rtems/score/coremutex.inl, macros/rtems/score/coresem.inl, macros/rtems/score/heap.inl, macros/rtems/score/isr.inl, macros/rtems/score/mppkt.inl, macros/rtems/score/object.inl, macros/rtems/score/objectmp.inl, macros/rtems/score/priority.inl, macros/rtems/score/stack.inl, macros/rtems/score/states.inl, macros/rtems/score/sysstate.inl, macros/rtems/score/thread.inl, macros/rtems/score/threadmp.inl, macros/rtems/score/tod.inl, macros/rtems/score/tqdata.inl, macros/rtems/score/userext.inl, macros/rtems/score/watchdog.inl, macros/rtems/score/wkspace.inl, src/apiext.c, src/chain.c, src/coremsg.c, src/coremsgbroadcast.c, src/coremsgclose.c, src/coremsgflush.c, src/coremsgflushsupp.c, src/coremsgflushwait.c, src/coremsginsert.c, src/coremsgseize.c, src/coremsgsubmit.c, src/coremutex.c, src/coremutexflush.c, src/coremutexseize.c, src/coremutexsurrender.c, src/coresem.c, src/coresemflush.c, src/coresemseize.c, src/coresemsurrender.c, src/coretod.c, src/coretodset.c, src/coretodtickle.c, src/coretodtoseconds.c, src/coretodvalidate.c, src/heap.c, src/heapallocate.c, src/heapextend.c, src/heapfree.c, src/heapgetinfo.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/interr.c, src/isr.c, src/iterateoverthreads.c, src/mpci.c, src/object.c, src/objectallocate.c, src/objectallocatebyindex.c, src/objectclearname.c, src/objectcomparenameraw.c, src/objectcomparenamestring.c, src/objectcopynameraw.c, src/objectcopynamestring.c, src/objectextendinformation.c, src/objectfree.c, src/objectget.c, src/objectgetbyindex.c, src/objectgetisr.c, src/objectgetnext.c, src/objectgetnoprotection.c, src/objectidtoname.c, src/objectinitializeinformation.c, src/objectmp.c, src/objectnametoid.c, src/objectshrinkinformation.c, src/thread.c, src/threadchangepriority.c, src/threadclearstate.c, src/threadclose.c, src/threadcreateidle.c, src/threaddelayended.c, src/threaddispatch.c, src/threadevaluatemode.c, src/threadget.c, src/threadhandler.c, src/threadidlebody.c, src/threadinitialize.c, src/threadloadenv.c, src/threadmp.c, src/threadq.c, src/threadqdequeue.c, src/threadqdequeuefifo.c, src/threadqdequeuepriority.c, src/threadqenqueue.c, src/threadqenqueuefifo.c, src/threadqenqueuepriority.c, src/threadqextract.c, src/threadqextractfifo.c, src/threadqextractpriority.c, src/threadqextractwithproxy.c, src/threadqfirst.c, src/threadqfirstfifo.c, src/threadqfirstpriority.c, src/threadqflush.c, src/threadqtimeout.c, src/threadready.c, src/threadreset.c, src/threadresettimeslice.c, src/threadrestart.c, src/threadresume.c, src/threadrotatequeue.c, src/threadsetpriority.c, src/threadsetstate.c, src/threadsettransient.c, src/threadstackallocate.c, src/threadstackfree.c, src/threadstart.c, src/threadstartmultitasking.c, src/threadsuspend.c, src/threadtickletimeslice.c, src/threadyieldprocessor.c, src/userext.c, src/watchdog.c, src/watchdogadjust.c, src/watchdoginsert.c, src/watchdogremove.c, src/watchdogtickle.c, src/wkspace.c: URL for license changed.
  • Property mode set to 100644
File size: 6.3 KB
Line 
1/*  coremsg.inl
2 *
3 *  This include file contains the static inline implementation of all
4 *  inlined routines in the Core Message Handler.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __CORE_MESSAGE_QUEUE_inl
17#define __CORE_MESSAGE_QUEUE_inl
18
19#include <string.h>   /* needed for memcpy */
20 
21/*PAGE
22 *
23 *  _CORE_message_queue_Send
24 *
25 *  DESCRIPTION:
26 *
27 *  This routine sends a message to the end of the specified message queue.
28 */
29 
30RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
31  CORE_message_queue_Control                *the_message_queue,
32  void                                      *buffer,
33  unsigned32                                 size,
34  Objects_Id                                 id,
35  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support,
36  boolean                                    wait,
37  Watchdog_Interval                          timeout
38)
39{
40  return _CORE_message_queue_Submit(
41    the_message_queue,
42    buffer,
43    size,
44    id,
45#if defined(RTEMS_MULTIPROCESSING)
46    api_message_queue_mp_support,
47#else
48    NULL,
49#endif
50    CORE_MESSAGE_QUEUE_SEND_REQUEST,
51    wait,     /* sender may block */
52    timeout   /* timeout interval */
53  );
54}
55 
56/*PAGE
57 *
58 *  _CORE_message_queue_Urgent
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine sends a message to the front of the specified message queue.
63 */
64 
65RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
66  CORE_message_queue_Control                *the_message_queue,
67  void                                      *buffer,
68  unsigned32                                 size,
69  Objects_Id                                 id,
70  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support,
71  boolean                                    wait,
72  Watchdog_Interval                          timeout
73)
74{
75  return _CORE_message_queue_Submit(
76    the_message_queue,
77    buffer,
78    size,
79    id,
80#if defined(RTEMS_MULTIPROCESSING)
81    api_message_queue_mp_support,
82#else
83    NULL,
84#endif
85    CORE_MESSAGE_QUEUE_URGENT_REQUEST,
86    wait,     /* sender may block */
87    timeout   /* timeout interval */
88 );
89}
90
91/*PAGE
92 *
93 *  _CORE_message_queue_Copy_buffer
94 *
95 *  DESCRIPTION:
96 *
97 *  This routine copies the contents of the source message buffer
98 *  to the destination message buffer.
99 */
100
101RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
102  void      *source,
103  void      *destination,
104  unsigned32 size
105)
106{
107  memcpy(destination, source, size);
108}
109
110/*PAGE
111 *
112 *  _CORE_message_queue_Allocate_message_buffer
113 *
114 *  DESCRIPTION:
115 *
116 *  This function allocates a message buffer from the inactive
117 *  message buffer chain.
118 */
119
120RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
121_CORE_message_queue_Allocate_message_buffer (
122    CORE_message_queue_Control *the_message_queue
123)
124{
125   return (CORE_message_queue_Buffer_control *)
126     _Chain_Get( &the_message_queue->Inactive_messages );
127}
128
129/*PAGE
130 *
131 *  _CORE_message_queue_Free_message_buffer
132 *
133 *  DESCRIPTION:
134 *
135 *  This routine frees a message buffer to the inactive
136 *  message buffer chain.
137 */
138
139RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
140    CORE_message_queue_Control        *the_message_queue,
141    CORE_message_queue_Buffer_control *the_message
142)
143{
144  _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
145}
146
147/*PAGE
148 *
149 *  _CORE_message_queue_Get_pending_message
150 *
151 *  DESCRIPTION:
152 *
153 *  This function removes the first message from the_message_queue
154 *  and returns a pointer to it.
155 */
156
157RTEMS_INLINE_ROUTINE
158  CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
159  CORE_message_queue_Control *the_message_queue
160)
161{
162  return (CORE_message_queue_Buffer_control *)
163    _Chain_Get_unprotected( &the_message_queue->Pending_messages );
164}
165
166/*PAGE
167 *
168 *  _CORE_message_queue_Is_priority
169 *
170 *  DESCRIPTION:
171 *
172 *  This function returns TRUE if the priority attribute is
173 *  enabled in the attribute_set and FALSE otherwise.
174 */
175 
176RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_priority(
177  CORE_message_queue_Attributes *the_attribute
178)
179{
180  return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
181}
182
183/*PAGE
184 *
185 *  _CORE_message_queue_Append
186 *
187 *  DESCRIPTION:
188 *
189 *  This routine places the_message at the rear of the outstanding
190 *  messages on the_message_queue.
191 */
192
193RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (
194  CORE_message_queue_Control        *the_message_queue,
195  CORE_message_queue_Buffer_control *the_message
196)
197{
198  _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
199}
200
201/*PAGE
202 *
203 *  _CORE_message_queue_Prepend
204 *
205 *  DESCRIPTION:
206 *
207 *  This routine places the_message at the front of the outstanding
208 *  messages on the_message_queue.
209 */
210
211RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (
212  CORE_message_queue_Control        *the_message_queue,
213  CORE_message_queue_Buffer_control *the_message
214)
215{
216  _Chain_Prepend(
217    &the_message_queue->Pending_messages,
218    &the_message->Node
219  );
220}
221
222/*PAGE
223 *
224 *  _CORE_message_queue_Is_null
225 *
226 *  DESCRIPTION:
227 *
228 *  This function returns TRUE if the_message_queue is TRUE and FALSE otherwise.
229 */
230
231RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_null (
232  CORE_message_queue_Control *the_message_queue
233)
234{
235  return ( the_message_queue == NULL  );
236}
237
238/*PAGE
239 *
240 *  _CORE_message_queue_Is_notify_enabled
241 *
242 *  DESCRIPTION:
243 *
244 *  This function returns TRUE if notification is enabled on this message
245 *  queue and FALSE otherwise.
246 */
247 
248RTEMS_INLINE_ROUTINE boolean _CORE_message_queue_Is_notify_enabled (
249  CORE_message_queue_Control *the_message_queue
250)
251{
252  return (the_message_queue->notify_handler != NULL);
253}
254 
255/*PAGE
256 *
257 *  _CORE_message_queue_Set_notify
258 *
259 *  DESCRIPTION:
260 *
261 *  This routine initializes the notification information for the_message_queue.
262 */
263 
264RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
265  CORE_message_queue_Control        *the_message_queue,
266  CORE_message_queue_Notify_Handler  the_handler,
267  void                              *the_argument
268)
269{
270  the_message_queue->notify_handler  = the_handler;
271  the_message_queue->notify_argument = the_argument;
272}
273
274#endif
275/* end of include file */
Note: See TracBrowser for help on using the repository browser.