source: rtems/cpukit/posix/include/rtems/posix/mqueue.h @ 39cefdd

4.104.114.84.9
Last change on this file since 39cefdd was 39cefdd, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 23, 2004 at 1:07:29 PM

2004-03-23 Ralf Corsepius <ralf_corsepius@…>

  • posix/include/rtems/posix/cond.h, posix/include/rtems/posix/intr.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/threadsup.h, posix/include/rtems/posix/timer.h, posix/src/cond.c, posix/src/intr.c, posix/src/key.c, posix/src/keycreate.c, posix/src/keydelete.c, posix/src/keygetspecific.c, posix/src/keyrundestructors.c, posix/src/keysetspecific.c, posix/src/killinfo.c, posix/src/mqueue.c, posix/src/mqueuerecvsupp.c, posix/src/mqueuesendsupp.c, posix/src/mqueuetranslatereturncode.c, posix/src/mutex.c, posix/src/posixintervaltotimespec.c, posix/src/posixtimespecsubtract.c, posix/src/psignal.c, posix/src/pthread.c, posix/src/ptimer1.c, posix/src/semaphore.c, posix/src/sysconf.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*  rtems/posix/mqueue.h
2 *
3 *  This include file contains all the private support information for
4 *  POSIX Message Queues.
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 __RTEMS_POSIX_MESSAGE_QUEUE_h
17#define __RTEMS_POSIX_MESSAGE_QUEUE_h
18 
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <signal.h>
24
25#include <rtems/score/coremsg.h>
26#include <rtems/score/object.h>
27
28/*
29 *  Data Structure used to manage a POSIX message queue
30 */
31 
32typedef struct {
33   Objects_Control             Object;
34   int                         process_shared;
35   boolean                     named;
36   boolean                     linked;
37   uint32_t                    open_count;
38   CORE_message_queue_Control  Message_queue;
39   struct sigevent             notification;
40}  POSIX_Message_queue_Control;
41
42typedef struct {
43   Objects_Control              Object;
44   POSIX_Message_queue_Control *Queue;
45   int                          oflag;
46} POSIX_Message_queue_Control_fd;
47
48/*
49 *  The following defines the information control block used to manage
50 *  this class of objects.  The second item is used to manage the set
51 *  of "file descriptors" associated with the message queues.
52 */
53 
54POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
55POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information_fds;
56 
57/*
58 *  _POSIX_Message_queue_Manager_initialization
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine performs the initialization necessary for this manager.
63 */
64 
65void _POSIX_Message_queue_Manager_initialization(
66  uint32_t   maximum_message_queues
67);
68 
69/*
70 *
71 *  _POSIX_Message_queue_Create_support
72 *
73 *  DESCRIPTION:
74 *
75 *  This routine performs the creation of a message queue utilizing the
76 *  core message queue.
77 */
78 
79int _POSIX_Message_queue_Create_support(
80  const char                    *name,
81  int                            pshared,
82  struct mq_attr                *attr,
83  POSIX_Message_queue_Control  **message_queue
84);
85
86/*
87 *  _POSIX_Message_queue_Delete
88 *
89 *  DESCRIPTION:
90 *
91 *  This routine supports the mq_unlink and mq_close routines by
92 *  doing most of the work involved with removing a message queue.
93 */ 
94 
95void _POSIX_Message_queue_Delete(
96  POSIX_Message_queue_Control *the_mq
97);
98
99/*
100 *  _POSIX_Message_queue_Receive_support
101 *
102 *  DESCRIPTION:
103 *
104 *  This routine supports the various flavors of receiving a message.
105 */
106
107ssize_t _POSIX_Message_queue_Receive_support(
108  mqd_t               mqdes,
109  char               *msg_ptr,
110  size_t              msg_len,
111  unsigned int       *msg_prio,
112  Watchdog_Interval   timeout
113);
114
115/*
116 *  _POSIX_Message_queue_Send_support
117 *
118 *  DESCRIPTION:
119 *
120 *  This routine posts a message to a specified message queue.
121 */
122
123int _POSIX_Message_queue_Send_support(
124  mqd_t               mqdes,
125  const char         *msg_ptr,
126  uint32_t            msg_len,
127  uint32_t            msg_prio,
128  Watchdog_Interval   timeout
129);
130
131/*
132 *  _POSIX_Message_queue_Allocate
133 *
134 *  DESCRIPTION:
135 *
136 *  This function allocates a message queue control block from
137 *  the inactive chain of free message queue control blocks.
138 */
139 
140RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
141 
142/*
143 *  _POSIX_Message_queue_Free
144 *
145 *  DESCRIPTION:
146 *
147 *  This routine frees a message queue control block to the
148 *  inactive chain of free message queue control blocks.
149 */
150 
151RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
152  POSIX_Message_queue_Control *the_mq
153);
154 
155/*
156 *  _POSIX_Message_queue_Get
157 *
158 *  DESCRIPTION:
159 *
160 *  This function maps message queue IDs to message queue control blocks.
161 *  If ID corresponds to a local message queue, then it returns
162 *  the_mq control pointer which maps to ID and location
163 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
164 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
165 *  and the_message queue is undefined.  Otherwise, location is set
166 *  to OBJECTS_ERROR and the_mq is undefined.
167 */
168 
169RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
170  Objects_Id         id,
171  Objects_Locations *location
172);
173 
174/*
175 *  _POSIX_Message_queue_Is_null
176 *
177 *  DESCRIPTION:
178 *
179 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
180 */
181 
182RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
183  POSIX_Message_queue_Control *the_mq
184);
185
186/*
187 *  _POSIX_Message_queue_Name_to_id
188 *
189 *  DESCRIPTION:
190 *
191 *  This routine looks up the specified name for a message queue and returns the
192 *  id of the message queue associated with it.
193 */
194
195int _POSIX_Message_queue_Name_to_id(
196  const char          *name,
197  Objects_Id          *id
198);
199
200/*
201 *  _POSIX_Message_queue_Priority_to_core
202 *
203 *  DESCRIPTION:
204 *
205 *  XXX
206 */
207 
208RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
209  unsigned int priority
210);
211
212/*
213 *  _POSIX_Message_queue_Priority_from_core
214 *
215 *  DESCRIPTION:
216 *
217 *  XXX
218 */
219 
220RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
221  CORE_message_queue_Submit_types priority
222);
223
224/*PAGE
225 *
226 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
227 *
228 *  DESCRIPTION:
229 *
230 *  XXX
231 */
232
233int _POSIX_Message_queue_Translate_core_message_queue_return_code(
234  uint32_t   the_message_queue_status
235);
236
237
238#include <rtems/posix/mqueue.inl>
239#if defined(RTEMS_MULTIPROCESSING)
240#include <rtems/posix/mqueuemp.h>
241#endif
242
243#ifdef __cplusplus
244}
245#endif
246 
247#endif
248/*  end of include file */
249
Note: See TracBrowser for help on using the repository browser.