OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [include/] [rtems/] [posix/] [mqueue.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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.OARcorp.com/rtems/license.html.
12
 *
13
 *  mqueue.h,v 1.15 2002/04/26 23:39:01 joel Exp
14
 */
15
 
16
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
17
#define __RTEMS_POSIX_MESSAGE_QUEUE_h
18
 
19
#ifdef __cplusplus
20
extern "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
 
32
typedef struct {
33
   Objects_Control             Object;
34
   int                         process_shared;
35
   boolean                     named;
36
   boolean                     linked;
37
   unsigned32                  open_count;
38
   CORE_message_queue_Control  Message_queue;
39
   struct sigevent             notification;
40
}  POSIX_Message_queue_Control;
41
 
42
typedef 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
 
54
POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
55
POSIX_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
 
65
void _POSIX_Message_queue_Manager_initialization(
66
  unsigned32 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
 
79
int _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
 
95
void _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
 
107
ssize_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
 
123
int _POSIX_Message_queue_Send_support(
124
  mqd_t               mqdes,
125
  const char         *msg_ptr,
126
  unsigned32          msg_len,
127
  unsigned32          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
 
140
RTEMS_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
 
151
RTEMS_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
 
169
RTEMS_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
 
182
RTEMS_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
 
195
int _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
 
208
RTEMS_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
 
220
RTEMS_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
 
233
int _POSIX_Message_queue_Translate_core_message_queue_return_code(
234
  unsigned32 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.