]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/mach_types.h
xnu-792.12.6.tar.gz
[apple/xnu.git] / osfmk / mach / mach_types.h
1 /*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
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@
29 */
30 /*
31 * @OSF_COPYRIGHT@
32 */
33 /*
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
36 * All Rights Reserved.
37 *
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
43 *
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
47 *
48 * Carnegie Mellon requests users of this software to return to
49 *
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
57 */
58 /*
59 */
60 /*
61 * File: mach/mach_types.h
62 * Author: Avadis Tevanian, Jr., Michael Wayne Young
63 * Date: 1986
64 *
65 * Mach external interface definitions.
66 *
67 */
68
69 #ifndef _MACH_MACH_TYPES_H_
70 #define _MACH_MACH_TYPES_H_
71
72 #include <stdint.h>
73
74 #include <sys/cdefs.h>
75
76 #include <mach/host_info.h>
77 #include <mach/host_notify.h>
78 #include <mach/host_special_ports.h>
79 #include <mach/machine.h>
80 #include <mach/machine/vm_types.h>
81 #include <mach/memory_object_types.h>
82 #include <mach/message.h>
83 #include <mach/exception_types.h>
84 #include <mach/port.h>
85 #include <mach/processor_info.h>
86 #include <mach/task_info.h>
87 #include <mach/task_policy.h>
88 #include <mach/task_special_ports.h>
89 #include <mach/thread_info.h>
90 #include <mach/thread_policy.h>
91 #include <mach/thread_special_ports.h>
92 #include <mach/thread_status.h>
93 #include <mach/time_value.h>
94 #include <mach/clock_types.h>
95 #include <mach/vm_attributes.h>
96 #include <mach/vm_inherit.h>
97 #include <mach/vm_purgable.h>
98 #include <mach/vm_behavior.h>
99 #include <mach/vm_prot.h>
100 #include <mach/vm_statistics.h>
101 #include <mach/vm_sync.h>
102 #include <mach/vm_types.h>
103 #include <mach/vm_region.h>
104 #include <mach/kmod.h>
105
106 #ifdef KERNEL
107
108 #include <mach/vm_param.h>
109
110 /*
111 * If we are in the kernel, then pick up the kernel definitions for
112 * the basic mach types.
113 */
114 typedef struct task *task_t;
115 typedef struct thread *thread_t, *thread_act_t;
116 typedef struct ipc_space *ipc_space_t;
117 typedef struct host *host_t;
118 typedef struct host *host_priv_t;
119 typedef struct host *host_security_t;
120 typedef struct processor *processor_t;
121 typedef struct processor_set *processor_set_t;
122 typedef struct processor_set *processor_set_control_t;
123 typedef struct semaphore *semaphore_t;
124 typedef struct lock_set *lock_set_t;
125 typedef struct ledger *ledger_t;
126 typedef struct alarm *alarm_t;
127 typedef struct clock *clock_serv_t;
128 typedef struct clock *clock_ctrl_t;
129
130 #ifndef MACH_KERNEL_PRIVATE
131
132 __BEGIN_DECLS
133
134 struct task ;
135 struct thread ;
136 struct host ;
137 struct processor ;
138 struct processor_set ;
139 struct semaphore ;
140 struct lock_set ;
141 struct ledger ;
142 struct alarm ;
143 struct clock ;
144
145 __END_DECLS
146
147 #endif /* MACH_KERNEL_PRIVATE */
148
149 #else /* KERNEL */
150
151 /*
152 * If we are not in the kernel, then these will all be represented by
153 * ports at user-space.
154 */
155 typedef mach_port_t task_t;
156 typedef mach_port_t thread_t;
157 typedef mach_port_t thread_act_t;
158 typedef mach_port_t ipc_space_t;
159 typedef mach_port_t host_t;
160 typedef mach_port_t host_priv_t;
161 typedef mach_port_t host_security_t;
162 typedef mach_port_t processor_t;
163 typedef mach_port_t processor_set_t;
164 typedef mach_port_t processor_set_control_t;
165 typedef mach_port_t semaphore_t;
166 typedef mach_port_t lock_set_t;
167 typedef mach_port_t ledger_t;
168 typedef mach_port_t alarm_t;
169 typedef mach_port_t clock_serv_t;
170 typedef mach_port_t clock_ctrl_t;
171
172 #endif /* KERNEL */
173
174 /*
175 * These aren't really unique types. They are just called
176 * out as unique types at one point in history. So we list
177 * them here for compatibility.
178 */
179 typedef processor_set_t processor_set_name_t;
180
181 /*
182 * These types are just hard-coded as ports
183 */
184 typedef mach_port_t clock_reply_t;
185 typedef mach_port_t bootstrap_t;
186 typedef mach_port_t mem_entry_name_port_t;
187 typedef mach_port_t exception_handler_t;
188 typedef exception_handler_t *exception_handler_array_t;
189 typedef mach_port_t vm_task_entry_t;
190 typedef mach_port_t io_master_t;
191 typedef mach_port_t UNDServerRef;
192
193 /*
194 * Mig doesn't translate the components of an array.
195 * For example, Mig won't use the thread_t translations
196 * to translate a thread_array_t argument. So, these definitions
197 * are not completely accurate at the moment for other kernel
198 * components.
199 */
200 typedef task_t *task_array_t;
201 typedef thread_t *thread_array_t;
202 typedef processor_set_t *processor_set_array_t;
203 typedef processor_set_t *processor_set_name_array_t;
204 typedef processor_t *processor_array_t;
205 typedef thread_act_t *thread_act_array_t;
206 typedef ledger_t *ledger_array_t;
207
208 /*
209 * However the real mach_types got declared, we also have to declare
210 * types with "port" in the name for compatability with the way OSF
211 * had declared the user interfaces at one point. Someday these should
212 * go away.
213 */
214 typedef task_t task_port_t;
215 typedef task_array_t task_port_array_t;
216 typedef thread_t thread_port_t;
217 typedef thread_array_t thread_port_array_t;
218 typedef ipc_space_t ipc_space_port_t;
219 typedef host_t host_name_t;
220 typedef host_t host_name_port_t;
221 typedef processor_set_t processor_set_port_t;
222 typedef processor_set_t processor_set_name_port_t;
223 typedef processor_set_array_t processor_set_name_port_array_t;
224 typedef processor_set_t processor_set_control_port_t;
225 typedef processor_t processor_port_t;
226 typedef processor_array_t processor_port_array_t;
227 typedef thread_act_t thread_act_port_t;
228 typedef thread_act_array_t thread_act_port_array_t;
229 typedef semaphore_t semaphore_port_t;
230 typedef lock_set_t lock_set_port_t;
231 typedef ledger_t ledger_port_t;
232 typedef ledger_array_t ledger_port_array_t;
233 typedef alarm_t alarm_port_t;
234 typedef clock_serv_t clock_serv_port_t;
235 typedef clock_ctrl_t clock_ctrl_port_t;
236 typedef exception_handler_t exception_port_t;
237 typedef exception_handler_array_t exception_port_arrary_t;
238
239
240 #define TASK_NULL ((task_t) 0)
241 #define THREAD_NULL ((thread_t) 0)
242 #define THR_ACT_NULL ((thread_act_t) 0)
243 #define IPC_SPACE_NULL ((ipc_space_t) 0)
244 #define HOST_NULL ((host_t) 0)
245 #define HOST_PRIV_NULL ((host_priv_t)0)
246 #define HOST_SECURITY_NULL ((host_security_t)0)
247 #define PROCESSOR_SET_NULL ((processor_set_t) 0)
248 #define PROCESSOR_NULL ((processor_t) 0)
249 #define SEMAPHORE_NULL ((semaphore_t) 0)
250 #define LOCK_SET_NULL ((lock_set_t) 0)
251 #define LEDGER_NULL ((ledger_t) 0)
252 #define ALARM_NULL ((alarm_t) 0)
253 #define CLOCK_NULL ((clock_t) 0)
254 #define UND_SERVER_NULL ((UNDServerRef) 0)
255
256 typedef natural_t ledger_item_t;
257 #define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
258
259 typedef mach_vm_offset_t *emulation_vector_t;
260 typedef char *user_subsystem_t;
261
262 /*
263 * Backwards compatibility, for those programs written
264 * before mach/{std,mach}_types.{defs,h} were set up.
265 */
266 #include <mach/std_types.h>
267
268 #endif /* _MACH_MACH_TYPES_H_ */