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