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 | |
---|
26 | STATIC 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 | |
---|
50 | STATIC 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 | |
---|
74 | STATIC 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 | |
---|
89 | STATIC 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 | |
---|
104 | STATIC 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 | |
---|
118 | STATIC 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 | |
---|
133 | STATIC 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 | |
---|
146 | STATIC 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 | |
---|
160 | STATIC 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 | |
---|
177 | STATIC 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 | |
---|
185 | #endif |
---|
186 | /* end of include file */ |
---|