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