]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * The contents of this file constitute Original Code as defined in and | |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
11 | * | |
12 | * This Original Code and all software distributed under the License are | |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
19 | * | |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * @OSF_COPYRIGHT@ | |
24 | */ | |
25 | /* | |
26 | * Mach Operating System | |
27 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | |
28 | * All Rights Reserved. | |
29 | * | |
30 | * Permission to use, copy, modify and distribute this software and its | |
31 | * documentation is hereby granted, provided that both the copyright | |
32 | * notice and this permission notice appear in all copies of the | |
33 | * software, derivative works or modified versions, and any portions | |
34 | * thereof, and that both notices appear in supporting documentation. | |
35 | * | |
36 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
37 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
38 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
39 | * | |
40 | * Carnegie Mellon requests users of this software to return to | |
41 | * | |
42 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
43 | * School of Computer Science | |
44 | * Carnegie Mellon University | |
45 | * Pittsburgh PA 15213-3890 | |
46 | * | |
47 | * any improvements or extensions that they make and grant Carnegie Mellon | |
48 | * the rights to redistribute these changes. | |
49 | */ | |
50 | /* | |
51 | */ | |
52 | /* | |
53 | * File: mach/message.h | |
54 | * | |
55 | * Mach IPC message and primitive function definitions. | |
56 | */ | |
57 | ||
58 | #ifndef _MACH_MESSAGE_H_ | |
59 | #define _MACH_MESSAGE_H_ | |
60 | ||
61 | #ifdef MACH_KERNEL | |
62 | /* Have to have MIG parameter check for kernel */ | |
63 | #define TypeCheck 1 | |
64 | #define _MIG_KERNEL_SPECIFIC_CODE_ 1 | |
65 | #endif /* MACH_KERNEL */ | |
66 | ||
67 | #include <mach/kern_return.h> | |
68 | #include <mach/port.h> | |
69 | ||
70 | ||
71 | /* | |
72 | * The timeout mechanism uses mach_msg_timeout_t values, | |
73 | * passed by value. The timeout units are milliseconds. | |
74 | * It is controlled with the MACH_SEND_TIMEOUT | |
75 | * and MACH_RCV_TIMEOUT options. | |
76 | */ | |
77 | ||
78 | typedef natural_t mach_msg_timeout_t; | |
79 | ||
80 | /* | |
81 | * The value to be used when there is no timeout. | |
82 | * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.) | |
83 | */ | |
84 | ||
85 | #define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0) | |
86 | ||
87 | /* | |
88 | * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. It it isn't on, it | |
89 | * assumes the body of the message doesn't contain port rights or OOL | |
90 | * data. The field is set in received messages. A user task must | |
91 | * use caution in interpreting the body of a message if the bit isn't | |
92 | * on, because the mach_msg_type's in the body might "lie" about the | |
93 | * contents. If the bit isn't on, but the mach_msg_types | |
94 | * in the body specify rights or OOL data, the behavior is undefined. | |
95 | * (Ie, an error may or may not be produced.) | |
96 | * | |
97 | * The value of MACH_MSGH_BITS_REMOTE determines the interpretation | |
98 | * of the msgh_remote_port field. It is handled like a msgt_name. | |
99 | * | |
100 | * The value of MACH_MSGH_BITS_LOCAL determines the interpretation | |
101 | * of the msgh_local_port field. It is handled like a msgt_name. | |
102 | * | |
103 | * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote | |
104 | * and local fields, into a single value suitable for msgh_bits. | |
105 | * | |
106 | * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally. | |
107 | * | |
108 | * The unused bits should be zero and are reserved for the kernel | |
109 | * or for future interface expansion. | |
110 | */ | |
111 | ||
112 | #define MACH_MSGH_BITS_ZERO 0x00000000 | |
113 | #define MACH_MSGH_BITS_REMOTE_MASK 0x000000ff | |
114 | #define MACH_MSGH_BITS_LOCAL_MASK 0x0000ff00 | |
115 | #define MACH_MSGH_BITS_COMPLEX 0x80000000U | |
116 | #define MACH_MSGH_BITS_USER 0x8000ffffU | |
117 | ||
118 | #define MACH_MSGH_BITS_CIRCULAR 0x40000000 /* internal use only */ | |
119 | #define MACH_MSGH_BITS_USED 0xc000ffffU | |
120 | ||
121 | #define MACH_MSGH_BITS_PORTS_MASK \ | |
122 | (MACH_MSGH_BITS_REMOTE_MASK|MACH_MSGH_BITS_LOCAL_MASK) | |
123 | ||
124 | #define MACH_MSGH_BITS(remote, local) \ | |
125 | ((remote) | ((local) << 8)) | |
126 | #define MACH_MSGH_BITS_REMOTE(bits) \ | |
127 | ((bits) & MACH_MSGH_BITS_REMOTE_MASK) | |
128 | #define MACH_MSGH_BITS_LOCAL(bits) \ | |
129 | (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8) | |
130 | #define MACH_MSGH_BITS_PORTS(bits) \ | |
131 | ((bits) & MACH_MSGH_BITS_PORTS_MASK) | |
132 | #define MACH_MSGH_BITS_OTHER(bits) \ | |
133 | ((bits) &~ MACH_MSGH_BITS_PORTS_MASK) | |
134 | ||
135 | /* | |
136 | * Every message starts with a message header. | |
137 | * Following the message header are zero or more pairs of | |
138 | * type descriptors (mach_msg_type_t/mach_msg_type_long_t) and | |
139 | * data values. The size of the message must be specified in bytes, | |
140 | * and includes the message header, type descriptors, inline | |
141 | * data, and inline pointer for out-of-line data. | |
142 | * | |
143 | * The msgh_remote_port field specifies the destination of the message. | |
144 | * It must specify a valid send or send-once right for a port. | |
145 | * | |
146 | * The msgh_local_port field specifies a "reply port". Normally, | |
147 | * This field carries a send-once right that the receiver will use | |
148 | * to reply to the message. It may carry the values MACH_PORT_NULL, | |
149 | * MACH_PORT_DEAD, a send-once right, or a send right. | |
150 | * | |
151 | * The msgh_seqno field carries a sequence number associated with the | |
152 | * received-from port. A port's sequence number is incremented every | |
153 | * time a message is received from it. In sent messages, the field's | |
154 | * value is ignored. | |
155 | * | |
156 | * The msgh_id field is uninterpreted by the message primitives. | |
157 | * It normally carries information specifying the format | |
158 | * or meaning of the message. | |
159 | */ | |
160 | ||
161 | typedef unsigned int mach_msg_bits_t; | |
162 | typedef natural_t mach_msg_size_t; | |
163 | typedef integer_t mach_msg_id_t; | |
164 | ||
165 | ||
166 | #define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0 | |
167 | ||
168 | typedef unsigned int mach_msg_type_name_t; | |
169 | ||
170 | #define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive rights */ | |
171 | #define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send rights */ | |
172 | #define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce rights */ | |
173 | #define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send rights */ | |
174 | #define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive rights */ | |
175 | #define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive rights */ | |
176 | #define MACH_MSG_TYPE_COPY_RECEIVE 22 /* Must hold receive rights */ | |
177 | ||
178 | typedef unsigned int mach_msg_copy_options_t; | |
179 | ||
180 | #define MACH_MSG_PHYSICAL_COPY 0 | |
181 | #define MACH_MSG_VIRTUAL_COPY 1 | |
182 | #define MACH_MSG_ALLOCATE 2 | |
183 | #define MACH_MSG_OVERWRITE 3 | |
184 | #ifdef MACH_KERNEL | |
185 | #define MACH_MSG_KALLOC_COPY_T 4 | |
186 | #define MACH_MSG_PAGE_LIST_COPY_T 5 | |
187 | #endif /* MACH_KERNEL */ | |
188 | ||
189 | typedef unsigned int mach_msg_descriptor_type_t; | |
190 | ||
191 | #define MACH_MSG_PORT_DESCRIPTOR 0 | |
192 | #define MACH_MSG_OOL_DESCRIPTOR 1 | |
193 | #define MACH_MSG_OOL_PORTS_DESCRIPTOR 2 | |
194 | #define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3 | |
195 | ||
196 | ||
197 | typedef struct | |
198 | { | |
199 | void* pad1; | |
200 | mach_msg_size_t pad2; | |
201 | unsigned int pad3 : 24; | |
202 | mach_msg_descriptor_type_t type : 8; | |
203 | } mach_msg_type_descriptor_t; | |
204 | ||
205 | typedef struct | |
206 | { | |
207 | mach_port_t name; | |
208 | mach_msg_size_t pad1; | |
209 | unsigned int pad2 : 16; | |
210 | mach_msg_type_name_t disposition : 8; | |
211 | mach_msg_descriptor_type_t type : 8; | |
212 | } mach_msg_port_descriptor_t; | |
213 | ||
214 | typedef struct | |
215 | { | |
216 | void* address; | |
217 | mach_msg_size_t size; | |
218 | boolean_t deallocate: 8; | |
219 | mach_msg_copy_options_t copy: 8; | |
220 | unsigned int pad1: 8; | |
221 | mach_msg_descriptor_type_t type: 8; | |
222 | } mach_msg_ool_descriptor_t; | |
223 | ||
224 | typedef struct | |
225 | { | |
226 | void* address; | |
227 | mach_msg_size_t count; | |
228 | boolean_t deallocate: 8; | |
229 | mach_msg_copy_options_t copy: 8; | |
230 | mach_msg_type_name_t disposition : 8; | |
231 | mach_msg_descriptor_type_t type : 8; | |
232 | } mach_msg_ool_ports_descriptor_t; | |
233 | ||
234 | typedef union | |
235 | { | |
236 | mach_msg_port_descriptor_t port; | |
237 | mach_msg_ool_descriptor_t out_of_line; | |
238 | mach_msg_ool_ports_descriptor_t ool_ports; | |
239 | mach_msg_type_descriptor_t type; | |
240 | } mach_msg_descriptor_t; | |
241 | ||
242 | typedef struct | |
243 | { | |
244 | mach_msg_size_t msgh_descriptor_count; | |
245 | } mach_msg_body_t; | |
246 | ||
247 | #define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0 | |
248 | #define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0 | |
249 | ||
250 | typedef struct | |
251 | { | |
252 | mach_msg_bits_t msgh_bits; | |
253 | mach_msg_size_t msgh_size; | |
254 | mach_port_t msgh_remote_port; | |
255 | mach_port_t msgh_local_port; | |
256 | mach_msg_size_t msgh_reserved; | |
257 | mach_msg_id_t msgh_id; | |
258 | } mach_msg_header_t; | |
259 | ||
260 | #define MACH_MSG_NULL (mach_msg_header_t *) 0 | |
261 | ||
262 | typedef struct | |
263 | { | |
264 | mach_msg_header_t header; | |
265 | mach_msg_body_t body; | |
266 | } mach_msg_base_t; | |
267 | ||
268 | typedef unsigned int mach_msg_trailer_type_t; | |
269 | ||
270 | #define MACH_MSG_TRAILER_FORMAT_0 0 | |
271 | ||
272 | typedef unsigned int mach_msg_trailer_size_t; | |
273 | ||
274 | typedef struct | |
275 | { | |
276 | mach_msg_trailer_type_t msgh_trailer_type; | |
277 | mach_msg_trailer_size_t msgh_trailer_size; | |
278 | } mach_msg_trailer_t; | |
279 | ||
280 | typedef struct | |
281 | { | |
282 | mach_msg_trailer_type_t msgh_trailer_type; | |
283 | mach_msg_trailer_size_t msgh_trailer_size; | |
284 | mach_port_seqno_t msgh_seqno; | |
285 | } mach_msg_seqno_trailer_t; | |
286 | ||
287 | typedef struct | |
288 | { | |
289 | unsigned int val[2]; | |
290 | } security_token_t; | |
291 | ||
292 | typedef struct | |
293 | { | |
294 | mach_msg_trailer_type_t msgh_trailer_type; | |
295 | mach_msg_trailer_size_t msgh_trailer_size; | |
296 | mach_port_seqno_t msgh_seqno; | |
297 | security_token_t msgh_sender; | |
298 | } mach_msg_security_trailer_t; | |
299 | ||
300 | typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; | |
301 | ||
302 | #define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t) | |
303 | #define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t) | |
304 | #define MAX_TRAILER_SIZE MACH_MSG_TRAILER_FORMAT_0_SIZE | |
305 | ||
306 | #define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} } | |
307 | extern security_token_t KERNEL_SECURITY_TOKEN; | |
308 | ||
309 | typedef integer_t mach_msg_options_t; | |
310 | ||
311 | typedef struct | |
312 | { | |
313 | mach_msg_header_t header; | |
314 | } mach_msg_empty_send_t; | |
315 | ||
316 | typedef struct | |
317 | { | |
318 | mach_msg_header_t header; | |
319 | mach_msg_trailer_t trailer; | |
320 | } mach_msg_empty_rcv_t; | |
321 | ||
322 | typedef union | |
323 | { | |
324 | mach_msg_empty_send_t send; | |
325 | mach_msg_empty_rcv_t rcv; | |
326 | } mach_msg_empty_t; | |
327 | ||
328 | /* utility to round the message size - will become machine dependent */ | |
329 | #define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \ | |
330 | ~(sizeof (natural_t) - 1)) | |
331 | ||
332 | /* | |
333 | * There is no fixed upper bound to the size of Mach messages. | |
334 | */ | |
335 | ||
336 | #define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0) | |
337 | ||
338 | /* | |
339 | * Compatibility definitions, for code written | |
340 | * when there was a msgh_kind instead of msgh_seqno. | |
341 | */ | |
342 | ||
343 | #define MACH_MSGH_KIND_NORMAL 0x00000000 | |
344 | #if 0 | |
345 | /* code using this is likely to break, so better not to have it defined */ | |
346 | #define MACH_MSGH_KIND_NOTIFICATION 0x00000001 | |
347 | #endif | |
348 | #define msgh_kind msgh_seqno | |
349 | #define mach_msg_kind_t mach_port_seqno_t | |
350 | ||
351 | /* | |
352 | * The msgt_number field specifies the number of data elements. | |
353 | * The msgt_size field specifies the size of each data element, in bits. | |
354 | * The msgt_name field specifies the type of each data element. | |
355 | * If msgt_inline is TRUE, the data follows the type descriptor | |
356 | * in the body of the message. If msgt_inline is FALSE, then a pointer | |
357 | * to the data should follow the type descriptor, and the data is | |
358 | * sent out-of-line. In this case, if msgt_deallocate is TRUE, | |
359 | * then the out-of-line data is moved (instead of copied) into the message. | |
360 | * If msgt_longform is TRUE, then the type descriptor is actually | |
361 | * a mach_msg_type_long_t. | |
362 | * | |
363 | * The actual amount of inline data following the descriptor must | |
364 | * a multiple of the word size. For out-of-line data, this is a | |
365 | * pointer. For inline data, the supplied data size (calculated | |
366 | * from msgt_number/msgt_size) is rounded up. This guarantees | |
367 | * that type descriptors always fall on word boundaries. | |
368 | * | |
369 | * For port rights, msgt_size must be 8*sizeof(mach_port_t). | |
370 | * If the data is inline, msgt_deallocate should be FALSE. | |
371 | * The msgt_unused bit should be zero. | |
372 | * The msgt_name, msgt_size, msgt_number fields in | |
373 | * a mach_msg_type_long_t should be zero. | |
374 | */ | |
375 | ||
376 | typedef natural_t mach_msg_type_size_t; | |
377 | typedef natural_t mach_msg_type_number_t; | |
378 | ||
379 | /* | |
380 | * Values received/carried in messages. Tells the receiver what | |
381 | * sort of port right he now has. | |
382 | * | |
383 | * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name | |
384 | * which should remain uninterpreted by the kernel. (Port rights | |
385 | * are not transferred, just the port name.) | |
386 | */ | |
387 | ||
388 | #define MACH_MSG_TYPE_PORT_NONE 0 | |
389 | ||
390 | #define MACH_MSG_TYPE_PORT_NAME 15 | |
391 | #define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE | |
392 | #define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND | |
393 | #define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE | |
394 | ||
395 | #define MACH_MSG_TYPE_LAST 22 /* Last assigned */ | |
396 | ||
397 | /* | |
398 | * A dummy value. Mostly used to indicate that the actual value | |
399 | * will be filled in later, dynamically. | |
400 | */ | |
401 | ||
402 | #define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1) | |
403 | ||
404 | /* | |
405 | * Is a given item a port type? | |
406 | */ | |
407 | ||
408 | #define MACH_MSG_TYPE_PORT_ANY(x) \ | |
409 | (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ | |
410 | ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) | |
411 | ||
412 | #define MACH_MSG_TYPE_PORT_ANY_SEND(x) \ | |
413 | (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \ | |
414 | ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) | |
415 | ||
416 | #define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \ | |
417 | (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ | |
418 | ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE)) | |
419 | ||
420 | typedef integer_t mach_msg_option_t; | |
421 | ||
422 | #define MACH_MSG_OPTION_NONE 0x00000000 | |
423 | ||
424 | #define MACH_SEND_MSG 0x00000001 | |
425 | #define MACH_RCV_MSG 0x00000002 | |
426 | #define MACH_RCV_LARGE 0x00000004 | |
427 | ||
428 | #define MACH_SEND_TIMEOUT 0x00000010 | |
429 | #define MACH_SEND_INTERRUPT 0x00000040 /* libmach implements */ | |
430 | #define MACH_SEND_CANCEL 0x00000080 | |
431 | #define MACH_SEND_ALWAYS 0x00010000 /* internal use only */ | |
432 | #define MACH_SEND_TRAILER 0x00020000 | |
433 | ||
434 | #define MACH_RCV_TIMEOUT 0x00000100 | |
435 | #define MACH_RCV_NOTIFY 0x00000200 | |
436 | #define MACH_RCV_INTERRUPT 0x00000400 /* libmach implements */ | |
437 | #define MACH_RCV_OVERWRITE 0x00001000 | |
438 | ||
439 | /* | |
440 | * NOTE: a 0x00------ RCV mask implies to ask for | |
441 | * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements, | |
442 | * which is equivalent to a mach_msg_trailer_t. | |
443 | */ | |
444 | #define MACH_RCV_TRAILER_NULL 0 | |
445 | #define MACH_RCV_TRAILER_SEQNO 1 | |
446 | #define MACH_RCV_TRAILER_SENDER 2 | |
447 | ||
448 | #define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28) | |
449 | #define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24) | |
450 | #define MACH_RCV_TRAILER_MASK ((0xff << 24)) | |
451 | ||
452 | extern mach_msg_trailer_size_t trailer_size[]; | |
453 | ||
454 | #define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf) | |
455 | #define REQUESTED_TRAILER_SIZE(y) (trailer_size[GET_RCV_ELEMENTS(y)]) | |
456 | ||
457 | /* | |
458 | * Much code assumes that mach_msg_return_t == kern_return_t. | |
459 | * This definition is useful for descriptive purposes. | |
460 | * | |
461 | * See <mach/error.h> for the format of error codes. | |
462 | * IPC errors are system 4. Send errors are subsystem 0; | |
463 | * receive errors are subsystem 1. The code field is always non-zero. | |
464 | * The high bits of the code field communicate extra information | |
465 | * for some error codes. MACH_MSG_MASK masks off these special bits. | |
466 | */ | |
467 | ||
468 | typedef kern_return_t mach_msg_return_t; | |
469 | ||
470 | #define MACH_MSG_SUCCESS 0x00000000 | |
471 | ||
472 | ||
473 | #define MACH_MSG_MASK 0x00003e00 | |
474 | /* All special error code bits defined below. */ | |
475 | #define MACH_MSG_IPC_SPACE 0x00002000 | |
476 | /* No room in IPC name space for another capability name. */ | |
477 | #define MACH_MSG_VM_SPACE 0x00001000 | |
478 | /* No room in VM address space for out-of-line memory. */ | |
479 | #define MACH_MSG_IPC_KERNEL 0x00000800 | |
480 | /* Kernel resource shortage handling an IPC capability. */ | |
481 | #define MACH_MSG_VM_KERNEL 0x00000400 | |
482 | /* Kernel resource shortage handling out-of-line memory. */ | |
483 | ||
484 | #define MACH_SEND_IN_PROGRESS 0x10000001 | |
485 | /* Thread is waiting to send. (Internal use only.) */ | |
486 | #define MACH_SEND_INVALID_DATA 0x10000002 | |
487 | /* Bogus in-line data. */ | |
488 | #define MACH_SEND_INVALID_DEST 0x10000003 | |
489 | /* Bogus destination port. */ | |
490 | #define MACH_SEND_TIMED_OUT 0x10000004 | |
491 | /* Message not sent before timeout expired. */ | |
492 | #define MACH_SEND_INTERRUPTED 0x10000007 | |
493 | /* Software interrupt. */ | |
494 | #define MACH_SEND_MSG_TOO_SMALL 0x10000008 | |
495 | /* Data doesn't contain a complete message. */ | |
496 | #define MACH_SEND_INVALID_REPLY 0x10000009 | |
497 | /* Bogus reply port. */ | |
498 | #define MACH_SEND_INVALID_RIGHT 0x1000000a | |
499 | /* Bogus port rights in the message body. */ | |
500 | #define MACH_SEND_INVALID_NOTIFY 0x1000000b | |
501 | /* Bogus notify port argument. */ | |
502 | #define MACH_SEND_INVALID_MEMORY 0x1000000c | |
503 | /* Invalid out-of-line memory pointer. */ | |
504 | #define MACH_SEND_NO_BUFFER 0x1000000d | |
505 | /* No message buffer is available. */ | |
506 | #define MACH_SEND_TOO_LARGE 0x1000000e | |
507 | /* Send is too large for port */ | |
508 | #define MACH_SEND_INVALID_TYPE 0x1000000f | |
509 | /* Invalid msg-type specification. */ | |
510 | #define MACH_SEND_INVALID_HEADER 0x10000010 | |
511 | /* A field in the header had a bad value. */ | |
512 | #define MACH_SEND_INVALID_TRAILER 0x10000011 | |
513 | /* The trailer to be sent does not match kernel format. */ | |
514 | #define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015 | |
515 | /* The OOL buffer size is too large for RT behavior */ | |
516 | ||
517 | #define MACH_RCV_IN_PROGRESS 0x10004001 | |
518 | /* Thread is waiting for receive. (Internal use only.) */ | |
519 | #define MACH_RCV_INVALID_NAME 0x10004002 | |
520 | /* Bogus name for receive port/port-set. */ | |
521 | #define MACH_RCV_TIMED_OUT 0x10004003 | |
522 | /* Didn't get a message within the timeout value. */ | |
523 | #define MACH_RCV_TOO_LARGE 0x10004004 | |
524 | /* Message buffer is not large enough for inline data. */ | |
525 | #define MACH_RCV_INTERRUPTED 0x10004005 | |
526 | /* Software interrupt. */ | |
527 | #define MACH_RCV_PORT_CHANGED 0x10004006 | |
528 | /* Port moved into a set during the receive. */ | |
529 | #define MACH_RCV_INVALID_NOTIFY 0x10004007 | |
530 | /* Bogus notify port argument. */ | |
531 | #define MACH_RCV_INVALID_DATA 0x10004008 | |
532 | /* Bogus message buffer for inline data. */ | |
533 | #define MACH_RCV_PORT_DIED 0x10004009 | |
534 | /* Port/set was sent away/died during receive. */ | |
535 | #define MACH_RCV_IN_SET 0x1000400a | |
536 | /* Port is a member of a port set. */ | |
537 | #define MACH_RCV_HEADER_ERROR 0x1000400b | |
538 | /* Error receiving message header. See special bits. */ | |
539 | #define MACH_RCV_BODY_ERROR 0x1000400c | |
540 | /* Error receiving message body. See special bits. */ | |
541 | #define MACH_RCV_INVALID_TYPE 0x1000400d | |
542 | /* Invalid msg-type specification in scatter list. */ | |
543 | #define MACH_RCV_SCATTER_SMALL 0x1000400e | |
544 | /* Out-of-line overwrite region is not large enough */ | |
545 | #define MACH_RCV_INVALID_TRAILER 0x1000400f | |
546 | /* trailer type or number of trailer elements not supported */ | |
547 | #define MACH_RCV_IN_PROGRESS_TIMED 0x10004011 | |
548 | /* Waiting for receive with timeout. (Internal use only.) */ | |
549 | ||
550 | extern mach_msg_return_t mach_msg_overwrite_trap( | |
551 | mach_msg_header_t *msg, | |
552 | mach_msg_option_t option, | |
553 | mach_msg_size_t send_size, | |
554 | mach_msg_size_t rcv_size, | |
555 | mach_port_name_t rcv_name, | |
556 | mach_msg_timeout_t timeout, | |
557 | mach_port_name_t notify, | |
558 | mach_msg_header_t *rcv_msg, | |
559 | mach_msg_size_t rcv_limit); | |
560 | ||
561 | extern mach_msg_return_t mach_msg_overwrite( | |
562 | mach_msg_header_t *msg, | |
563 | mach_msg_option_t option, | |
564 | mach_msg_size_t send_size, | |
565 | mach_msg_size_t rcv_size, | |
566 | mach_port_name_t rcv_name, | |
567 | mach_msg_timeout_t timeout, | |
568 | mach_port_name_t notify, | |
569 | mach_msg_header_t *rcv_msg, | |
570 | mach_msg_size_t rcv_limit); | |
571 | ||
572 | extern mach_msg_return_t mach_msg_trap( | |
573 | mach_msg_header_t *msg, | |
574 | mach_msg_option_t option, | |
575 | mach_msg_size_t send_size, | |
576 | mach_msg_size_t rcv_size, | |
577 | mach_port_name_t rcv_name, | |
578 | mach_msg_timeout_t timeout, | |
579 | mach_port_name_t notify); | |
580 | ||
581 | extern mach_msg_return_t mach_msg( | |
582 | mach_msg_header_t *msg, | |
583 | mach_msg_option_t option, | |
584 | mach_msg_size_t send_size, | |
585 | mach_msg_size_t rcv_size, | |
586 | mach_port_name_t rcv_name, | |
587 | mach_msg_timeout_t timeout, | |
588 | mach_port_name_t notify); | |
589 | ||
590 | #endif /* _MACH_MESSAGE_H_ */ |