source: rtems/c/src/exec/score/inline/coremsg.inl @ eb5a7e07

4.104.114.84.95
Last change on this file since eb5a7e07 was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 4.5 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, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __CORE_MESSAGE_QUEUE_inl
18#define __CORE_MESSAGE_QUEUE_inl
19
20/*PAGE
21 *
22 *  _CORE_message_queue_Send
23 *
24 */
25 
26STATIC INLINE CORE_message_queue_Status _CORE_message_queue_Send(
27  CORE_message_queue_Control                *the_message_queue,
28  void                                      *buffer,
29  unsigned32                                 size,
30  Objects_Id                                 id,
31  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support
32)
33{
34  return _CORE_message_queue_Submit(
35    the_message_queue,
36    buffer,
37    size,
38    id,
39    api_message_queue_mp_support,
40    CORE_MESSAGE_QUEUE_SEND_REQUEST
41  );
42}
43 
44/*PAGE
45 *
46 *  _CORE_message_queue_Urgent
47 *
48 */
49 
50STATIC INLINE CORE_message_queue_Status _CORE_message_queue_Urgent(
51  CORE_message_queue_Control                *the_message_queue,
52  void                                      *buffer,
53  unsigned32                                 size,
54  Objects_Id                                 id,
55  CORE_message_queue_API_mp_support_callout  api_message_queue_mp_support
56)
57{
58  return _CORE_message_queue_Submit(
59    the_message_queue,
60    buffer,
61    size,
62    id,
63    api_message_queue_mp_support,
64    CORE_MESSAGE_QUEUE_URGENT_REQUEST
65 );
66}
67
68/*PAGE
69 *
70 *  _CORE_message_queue_Copy_buffer
71 *
72 */
73
74STATIC INLINE void _CORE_message_queue_Copy_buffer (
75  void      *source,
76  void      *destination,
77  unsigned32 size
78)
79{
80  memcpy(destination, source, size);
81}
82
83/*PAGE
84 *
85 *  _CORE_message_queue_Allocate_message_buffer
86 *
87 */
88
89STATIC INLINE CORE_message_queue_Buffer_control *
90_CORE_message_queue_Allocate_message_buffer (
91    CORE_message_queue_Control *the_message_queue
92)
93{
94   return (CORE_message_queue_Buffer_control *)
95     _Chain_Get( &the_message_queue->Inactive_messages );
96}
97
98/*PAGE
99 *
100 *  _CORE_message_queue_Free_message_buffer
101 *
102 */
103
104STATIC INLINE void _CORE_message_queue_Free_message_buffer (
105    CORE_message_queue_Control        *the_message_queue,
106    CORE_message_queue_Buffer_control *the_message
107)
108{
109  _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
110}
111
112/*PAGE
113 *
114 *  _CORE_message_queue_Get_pending_message
115 *
116 */
117
118STATIC INLINE
119  CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message (
120  CORE_message_queue_Control *the_message_queue
121)
122{
123  return (CORE_message_queue_Buffer_control *)
124    _Chain_Get_unprotected( &the_message_queue->Pending_messages );
125}
126
127/*PAGE
128 *
129 *  _CORE_message_queue_Is_priority
130 *
131 */
132 
133STATIC INLINE boolean _CORE_message_queue_Is_priority(
134  CORE_message_queue_Attributes *the_attribute
135)
136{
137  return (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
138}
139
140/*PAGE
141 *
142 *  _CORE_message_queue_Append
143 *
144 */
145
146STATIC INLINE void _CORE_message_queue_Append (
147  CORE_message_queue_Control        *the_message_queue,
148  CORE_message_queue_Buffer_control *the_message
149)
150{
151  _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
152}
153
154/*PAGE
155 *
156 *  _CORE_message_queue_Prepend
157 *
158 */
159
160STATIC INLINE void _CORE_message_queue_Prepend (
161  CORE_message_queue_Control        *the_message_queue,
162  CORE_message_queue_Buffer_control *the_message
163)
164{
165  _Chain_Prepend(
166    &the_message_queue->Pending_messages,
167    &the_message->Node
168  );
169}
170
171/*PAGE
172 *
173 *  _CORE_message_queue_Is_null
174 *
175 */
176
177STATIC INLINE boolean _CORE_message_queue_Is_null (
178  CORE_message_queue_Control *the_message_queue
179)
180{
181  return ( the_message_queue == NULL  );
182}
183
184/*PAGE
185 *
186 *  _CORE_message_queue_Is_notify_enabled
187 *
188 */
189 
190STATIC INLINE boolean _CORE_message_queue_Is_notify_enabled (
191  CORE_message_queue_Control *the_message_queue
192)
193{
194  return (the_message_queue->notify_handler != NULL);
195}
196 
197/*PAGE
198 *
199 *  _CORE_message_queue_Set_notify
200 *
201 */
202 
203STATIC INLINE void _CORE_message_queue_Set_notify (
204  CORE_message_queue_Control        *the_message_queue,
205  CORE_message_queue_Notify_Handler  the_handler,
206  void                              *the_argument
207)
208{
209  the_message_queue->notify_handler  = the_handler;
210  the_message_queue->notify_argument = the_argument;
211}
212
213#endif
214/* end of include file */
Note: See TracBrowser for help on using the repository browser.