source: rtems/cpukit/posix/include/rtems/posix/mqueue.h @ 5ec2f12d

4.104.114.84.95
Last change on this file since 5ec2f12d was 5ec2f12d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/21/05 at 07:20:13

New header guards.

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