source: rtems/c/src/exec/rtems/inline/message.inl @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*  message.inl
2 *
3 *  This include file contains the static inline implementation of all
4 *  inlined routines in the Message Manager.
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 __MESSAGE_QUEUE_inl
18#define __MESSAGE_QUEUE_inl
19
20/*PAGE
21 *
22 *  _Message_queue_Copy_buffer
23 *
24 */
25
26STATIC INLINE void _Message_queue_Copy_buffer (
27  Message_queue_Buffer *source,
28  Message_queue_Buffer *destination
29)
30{
31  *destination = *source;
32}
33
34/*PAGE
35 *
36 *  _Message_queue_Allocate_message_buffer
37 *
38 */
39
40STATIC INLINE Message_queue_Buffer_control *
41  _Message_queue_Allocate_message_buffer ( void )
42{
43   return (Message_queue_Buffer_control *)
44     _Chain_Get( &_Message_queue_Inactive_messages );
45}
46
47/*PAGE
48 *
49 *  _Message_queue_Free_message_buffer
50 *
51 */
52
53STATIC INLINE void _Message_queue_Free_message_buffer (
54  Message_queue_Buffer_control *the_message
55)
56{
57 _Chain_Append( &_Message_queue_Inactive_messages, &the_message->Node );
58}
59
60/*PAGE
61 *
62 *  _Message_queue_Get_pending_message
63 *
64 */
65
66STATIC INLINE
67  Message_queue_Buffer_control *_Message_queue_Get_pending_message (
68  Message_queue_Control *the_message_queue
69)
70{
71  return (Message_queue_Buffer_control *)
72    _Chain_Get_unprotected( &the_message_queue->Pending_messages );
73}
74
75/*PAGE
76 *
77 *  _Message_queue_Append
78 *
79 */
80
81STATIC INLINE void _Message_queue_Append (
82  Message_queue_Control        *the_message_queue,
83  Message_queue_Buffer_control *the_message
84)
85{
86  _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
87}
88
89/*PAGE
90 *
91 *  _Message_queue_Prepend
92 *
93 */
94
95STATIC INLINE void _Message_queue_Prepend (
96  Message_queue_Control        *the_message_queue,
97  Message_queue_Buffer_control *the_message
98)
99{
100  _Chain_Prepend(
101    &the_message_queue->Pending_messages,
102    &the_message->Node
103  );
104}
105
106/*PAGE
107 *
108 *  _Message_queue_Is_null
109 *
110 */
111
112STATIC INLINE boolean _Message_queue_Is_null (
113  Message_queue_Control *the_message_queue
114)
115{
116  return ( the_message_queue == NULL  );
117}
118
119/*PAGE
120 *
121 *  _Message_queue_Allocate
122 *
123 */
124
125STATIC INLINE Message_queue_Control *_Message_queue_Allocate ( void )
126{
127  return (Message_queue_Control *)
128     _Objects_Allocate( &_Message_queue_Information );
129}
130
131/*PAGE
132 *
133 *  _Message_queue_Free
134 *
135 */
136
137STATIC INLINE void _Message_queue_Free (
138  Message_queue_Control *the_message_queue
139)
140{
141  _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
142}
143
144/*PAGE
145 *
146 *  _Message_queue_Get
147 *
148 */
149
150STATIC INLINE Message_queue_Control *_Message_queue_Get (
151  Objects_Id         id,
152  Objects_Locations *location
153)
154{
155  return (Message_queue_Control *)
156     _Objects_Get( &_Message_queue_Information, id, location );
157}
158
159#endif
160/* end of include file */
Note: See TracBrowser for help on using the repository browser.