2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
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
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
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.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
37 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
38 * Import of Mac OS X kernel (~semeria)
40 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
41 * Import of OSF Mach kernel (~mburg)
43 * Revision 1.1.7.1 1996/09/17 16:34:35 bruel
47 * Revision 1.1.5.1 1995/06/13 18:20:20 sjs
48 * Merged from flipc_shared.
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.
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
61 * Revision 1.1.3.9 1995/05/16 20:46:35 randys
62 * Added a "performance_valid" field to the flipc performance
66 * Revision 1.1.3.8 1995/04/05 21:22:01 randys
67 * Added field to domain_info struct to include allocations lock
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
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.
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]
86 * Revision 1.1.3.4 1995/02/16 23:20:14 randys
87 * ANSIfy FLIPC_thread_yield_function.
90 * Add FLIPC_thread_yield_function type.
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]
97 * Added FLIPC_epgroup_info struct
98 * [1995/01/24 18:30:02 randys]
100 * Create a new structure (FLIPC_endpoint_info) to return
101 * information about an endpoint.
102 * [1995/01/20 19:26:35 randys]
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]
108 * Added domain index type for specifying domain in
109 * init and attach calls
110 * [1995/01/18 16:47:25 randys]
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]
117 * Added filename in comment at top of each file
118 * [1994/12/19 20:28:26 randys]
120 * Support and doc for minor user interface changes for error conditions
121 * [1994/12/18 23:24:30 randys]
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]
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]
132 * Revision 1.1.1.2 1994/12/11 23:11:23 randys
133 * Initial flipc code checkin
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).
145 #ifndef _MACH_FLIPC_TYPES_H_
146 #define _MACH_FLIPC_TYPES_H_
148 #include <mach/port.h>
151 * Define a couple of generally useful types.
153 #include <mach/mach_types.h>
156 #define SEMAPHORE_NULL (semaphore_port_t)0
157 #endif /* !defined(MACH_KERNEL) */
160 * Basic flipc types; visible to both user and kernel segments of the
161 * flipc implementation.
163 /* Flipc addresses. These name a node-endpoint combination for
165 typedef unsigned int FLIPC_address_t
;
166 #define FLIPC_ADDRESS_ERROR ((FLIPC_address_t) -1)
168 /* Flipc endpoints. */
169 typedef void *FLIPC_endpoint_t
;
170 #define FLIPC_ENDPOINT_NULL ((FLIPC_endpoint_t) 0)
172 /* Buffer pointers (returned by query functions). Users are allowed to
173 copy directly to/from this pointer; it points at their data. */
174 typedef void *FLIPC_buffer_t
;
175 #define FLIPC_BUFFER_NULL ((FLIPC_buffer_t) 0)
177 /* Endpoint group identifiers. */
178 typedef void *FLIPC_epgroup_t
;
179 #define FLIPC_EPGROUP_NULL ((FLIPC_epgroup_t) 0)
180 #define FLIPC_EPGROUP_ERROR ((FLIPC_epgroup_t) -1)
182 /* Domain index; argument to initialization and attach routines. */
183 typedef unsigned int FLIPC_domain_index_t
;
185 /* Domain handle (mach port). */
186 typedef mach_port_t FLIPC_domain_t
;
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. */
194 } FLIPC_endpoint_type_t
;
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. */
200 typedef 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
;
211 /* Flipc yield function. */
212 typedef void (*FLIPC_thread_yield_function
)(void);
214 /* Structure for returning information about the flipc domain. */
215 typedef struct FLIPC_domain_info
{
219 int max_buffers_per_endpoint
;
221 FLIPC_thread_yield_function yield_fn
;
222 int policy
; /* Allocations lock sched policy.
223 Unused if REAL_TIME_PRIMITIVES are
225 struct FLIPC_domain_performance_info performance
;
226 int error_log_size
; /* In bytes. */
227 } *FLIPC_domain_info_t
;
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
233 typedef struct FLIPC_domain_errors
{
234 int error_full_config_p
; /* 1 if disabled and badtype below are
235 valid; 0 if only msgdrop_inactive
237 int msgdrop_inactive
; /* Messages dropped because
238 of the domain being locally
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. */
245 int transport_error_size
; /* Size of the following array of
247 int transport_error_info
[1]; /* Really of transport_error_size. */
248 } *FLIPC_domain_errors_t
;
250 /* Structure for returning information about endpoints. */
251 typedef 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
;
258 typedef struct FLIPC_epgroup_info
{
259 unsigned long msgs_per_wakeup
;
260 } *FLIPC_epgroup_info_t
;
262 #endif /* _MACH_FLIPC_TYPES_H_ */