]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/flipc_types.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / osfmk / mach / flipc_types.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 * @OSF_COPYRIGHT@
32 *
33 */
34/*
35 * HISTORY
36 *
37 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
38 * Import of Mac OS X kernel (~semeria)
39 *
40 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
41 * Import of OSF Mach kernel (~mburg)
42 *
43 * Revision 1.1.7.1 1996/09/17 16:34:35 bruel
44 * fixed types.
45 * [96/09/17 bruel]
46 *
47 * Revision 1.1.5.1 1995/06/13 18:20:20 sjs
48 * Merged from flipc_shared.
49 * [95/06/07 sjs]
50 *
51 * Revision 1.1.3.11 1995/05/23 19:55:36 randys
52 * Don't keep track of messages sent to a bad destination--that's
53 * purely a transport function now.
54 * [95/05/23 randys]
55 *
56 * Revision 1.1.3.10 1995/05/23 15:40:20 randys
57 * Added field to FLIPC_domain_errors to indicate validity of other
58 * fields.
59 * [95/05/22 randys]
60 *
61 * Revision 1.1.3.9 1995/05/16 20:46:35 randys
62 * Added a "performance_valid" field to the flipc performance
63 * structure.
64 * [95/05/16 randys]
65 *
66 * Revision 1.1.3.8 1995/04/05 21:22:01 randys
67 * Added field to domain_info struct to include allocations lock
68 * sched policy.
69 * [95/04/05 randys]
70 *
71 * Revision 1.1.3.7 1995/03/09 19:42:33 rwd
72 * Define SEMAPHORE_NULL (for now) and include mach_types.h instead
73 * of sema_types.h.
74 * [95/03/08 rwd]
75 *
76 * Revision 1.1.3.6 1995/02/23 21:32:52 randys
77 * Removed placeholder definition for locks--I don't believe that I
78 * use locks unless I'm on top of a real time base, in which case
79 * that base will define the type.
80 * [95/02/22 randys]
81 *
82 * Revision 1.1.3.5 1995/02/21 17:23:13 randys
83 * Re-indented code to four space indentation
84 * [1995/02/21 16:25:36 randys]
85 *
86 * Revision 1.1.3.4 1995/02/16 23:20:14 randys
87 * ANSIfy FLIPC_thread_yield_function.
88 * [95/02/14 randys]
89 *
90 * Add FLIPC_thread_yield_function type.
91 * [95/02/14 randys]
92 *
93 * Revision 1.1.3.3 1995/01/26 21:01:51 randys
94 * Added performance structure.
95 * [1995/01/24 21:14:12 randys]
96 *
97 * Added FLIPC_epgroup_info struct
98 * [1995/01/24 18:30:02 randys]
99 *
100 * Create a new structure (FLIPC_endpoint_info) to return
101 * information about an endpoint.
102 * [1995/01/20 19:26:35 randys]
103 *
104 * Get rid of FLIPC_DESTINATION_NULL and add in
105 * FLIPC_ADDRESS_ERROR (return code from FLIPC_buffer_destination)
106 * [1995/01/19 20:23:24 randys]
107 *
108 * Added domain index type for specifying domain in
109 * init and attach calls
110 * [1995/01/18 16:47:25 randys]
111 *
112 * Revision 1.1.3.2 1994/12/20 19:02:09 randys
113 * Added error reporting structure type, and added
114 * room in the standard domain query for error log size.
115 * [1994/12/19 23:46:09 randys]
116 *
117 * Added filename in comment at top of each file
118 * [1994/12/19 20:28:26 randys]
119 *
120 * Support and doc for minor user interface changes for error conditions
121 * [1994/12/18 23:24:30 randys]
122 *
123 * Yank the semaphore type definitions back out, and include the file
124 * that defines those types.
125 * [1994/12/13 17:50:03 randys]
126 *
127 * Revision 1.1.3.1 1994/12/12 17:46:20 randys
128 * Put definitions of semaphore_t and SEMAPHORE_NULL back in; they aren't
129 * defined in user space yet.
130 * [1994/12/12 17:21:56 randys]
131 *
132 * Revision 1.1.1.2 1994/12/11 23:11:23 randys
133 * Initial flipc code checkin
134 *
135 * $EndLog$
136 */
137
138/*
139 * mach/flipc_types.h
140 *
141 * Definitions of those flipc types that need to be visible to both the AIL
142 * and kernel sides of flipc (which is just about everything).
143 */
144
145#ifndef _MACH_FLIPC_TYPES_H_
146#define _MACH_FLIPC_TYPES_H_
147
148#include <mach/port.h>
149
150/*
151 * Define a couple of generally useful types.
152 */
153#include <mach/mach_types.h>
154
155#ifndef MACH_KERNEL
156#define SEMAPHORE_NULL (semaphore_port_t)0
157#endif /* !defined(MACH_KERNEL) */
158
159/*
160 * Basic flipc types; visible to both user and kernel segments of the
161 * flipc implementation.
162 */
163/* Flipc addresses. These name a node-endpoint combination for
164 sending. */
165typedef unsigned int FLIPC_address_t;
166#define FLIPC_ADDRESS_ERROR ((FLIPC_address_t) -1)
167
168/* Flipc endpoints. */
169typedef void *FLIPC_endpoint_t;
170#define FLIPC_ENDPOINT_NULL ((FLIPC_endpoint_t) 0)
171
172/* Buffer pointers (returned by query functions). Users are allowed to
173 copy directly to/from this pointer; it points at their data. */
174typedef void *FLIPC_buffer_t;
175#define FLIPC_BUFFER_NULL ((FLIPC_buffer_t) 0)
176
177/* Endpoint group identifiers. */
178typedef void *FLIPC_epgroup_t;
179#define FLIPC_EPGROUP_NULL ((FLIPC_epgroup_t) 0)
180#define FLIPC_EPGROUP_ERROR ((FLIPC_epgroup_t) -1)
181
182/* Domain index; argument to initialization and attach routines. */
183typedef unsigned int FLIPC_domain_index_t;
184
185/* Domain handle (mach port). */
186typedef mach_port_t FLIPC_domain_t;
187
188/* The different types an endpoint can be. FLIPC_Inactive is used when
189 the endpoint has not been configured and hence is on the freelist. */
190typedef enum {
191 FLIPC_Inactive = -1,
192 FLIPC_Send,
193 FLIPC_Receive
194} FLIPC_endpoint_type_t;
195
196/* Structure for returning performance information about the flipc
197 domain; a placeholder for future entries as needed.
198 This information will only be valid if the kernel is configured to
199 keep flipc performance information. */
200typedef struct FLIPC_domain_performance_info {
201 unsigned long performance_valid; /* Non zero if the other information
202 in this structure is valid. */
203 unsigned long messages_sent; /* Since last init. */
204 unsigned long messages_received; /* Since last init. Includes overruns
205 (because they are marked in the
206 endpoint data structure). Doesn't
207 include other drops (they are
208 marked in other places) */
209} *FLIPC_domain_performance_info_t;
210
211/* Flipc yield function. */
212typedef void (*FLIPC_thread_yield_function)(void);
213
214/* Structure for returning information about the flipc domain. */
215typedef struct FLIPC_domain_info {
216 int max_endpoints;
217 int max_epgroups;
218 int max_buffers;
219 int max_buffers_per_endpoint;
220 int msg_buffer_size;
221 FLIPC_thread_yield_function yield_fn;
222 int policy; /* Allocations lock sched policy.
223 Unused if REAL_TIME_PRIMITIVES are
224 not being used. */
225 struct FLIPC_domain_performance_info performance;
226 int error_log_size; /* In bytes. */
227} *FLIPC_domain_info_t;
228
229/* Structure for returning information about the error state of
230 the flipc domain. Note that this is variable sized; the size
231 of the transport specific information is not known at compile
232 time. */
233typedef struct FLIPC_domain_errors {
234 int error_full_config_p; /* 1 if disabled and badtype below are
235 valid; 0 if only msgdrop_inactive
236 is valid. */
237 int msgdrop_inactive; /* Messages dropped because
238 of the domain being locally
239 inactive. */
240 int msgdrop_disabled; /* Messages dropped because of a
241 disabled endpoint. */
242 int msgdrop_badtype; /* Messages dropped because they
243 were sent to a send endpoint. */
244
245 int transport_error_size; /* Size of the following array of
246 ints, in bytes. */
247 int transport_error_info[1]; /* Really of transport_error_size. */
248} *FLIPC_domain_errors_t;
249
250/* Structure for returning information about endpoints. */
251typedef struct FLIPC_endpoint_info {
252 FLIPC_endpoint_type_t type;
253 unsigned int processed_buffers_dropped_p;
254 unsigned long number_buffers;
255 FLIPC_epgroup_t epgroup;
256} *FLIPC_endpoint_info_t;
257
258typedef struct FLIPC_epgroup_info {
259 unsigned long msgs_per_wakeup;
260} *FLIPC_epgroup_info_t;
261
262#endif /* _MACH_FLIPC_TYPES_H_ */