]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
cb323159 | 2 | * Copyright (c) 2000-2018 Apple Inc. All rights reserved. |
1c79356b | 3 | * |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
0a7de745 | 5 | * |
2d21ac55 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 License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
0a7de745 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
0a7de745 | 17 | * |
2d21ac55 A |
18 | * The Original Code and all software distributed under the License are |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
0a7de745 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
0a7de745 | 31 | /* |
1c79356b A |
32 | * Mach Operating System |
33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | |
34 | * All Rights Reserved. | |
0a7de745 | 35 | * |
1c79356b A |
36 | * Permission to use, copy, modify and distribute this software and its |
37 | * documentation is hereby granted, provided that both the copyright | |
38 | * notice and this permission notice appear in all copies of the | |
39 | * software, derivative works or modified versions, and any portions | |
40 | * thereof, and that both notices appear in supporting documentation. | |
0a7de745 | 41 | * |
1c79356b A |
42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
0a7de745 | 45 | * |
1c79356b | 46 | * Carnegie Mellon requests users of this software to return to |
0a7de745 | 47 | * |
1c79356b A |
48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU |
49 | * School of Computer Science | |
50 | * Carnegie Mellon University | |
51 | * Pittsburgh PA 15213-3890 | |
0a7de745 | 52 | * |
1c79356b A |
53 | * any improvements or extensions that they make and grant Carnegie Mellon |
54 | * the rights to redistribute these changes. | |
55 | */ | |
56 | /* | |
57 | */ | |
2d21ac55 A |
58 | /* |
59 | * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce | |
60 | * support for mandatory and extensible security protections. This notice | |
61 | * is included in support of clause 2.2 (b) of the Apple Public License, | |
62 | * Version 2.0. | |
63 | */ | |
1c79356b A |
64 | /* |
65 | * File: mach/mach_types.h | |
66 | * Author: Avadis Tevanian, Jr., Michael Wayne Young | |
67 | * Date: 1986 | |
68 | * | |
69 | * Mach external interface definitions. | |
70 | * | |
71 | */ | |
72 | ||
0a7de745 | 73 | #ifndef _MACH_MACH_TYPES_H_ |
1c79356b A |
74 | #define _MACH_MACH_TYPES_H_ |
75 | ||
0b4e3aa0 A |
76 | #include <stdint.h> |
77 | ||
91447636 A |
78 | #include <sys/cdefs.h> |
79 | ||
1c79356b | 80 | #include <mach/host_info.h> |
55e303ae A |
81 | #include <mach/host_notify.h> |
82 | #include <mach/host_special_ports.h> | |
1c79356b A |
83 | #include <mach/machine.h> |
84 | #include <mach/machine/vm_types.h> | |
85 | #include <mach/memory_object_types.h> | |
91447636 | 86 | #include <mach/message.h> |
1c79356b A |
87 | #include <mach/exception_types.h> |
88 | #include <mach/port.h> | |
fe8ab488 | 89 | #include <mach/mach_voucher_types.h> |
1c79356b A |
90 | #include <mach/processor_info.h> |
91 | #include <mach/task_info.h> | |
5ba3f43e | 92 | #include <mach/task_inspect.h> |
1c79356b A |
93 | #include <mach/task_policy.h> |
94 | #include <mach/task_special_ports.h> | |
95 | #include <mach/thread_info.h> | |
96 | #include <mach/thread_policy.h> | |
97 | #include <mach/thread_special_ports.h> | |
98 | #include <mach/thread_status.h> | |
99 | #include <mach/time_value.h> | |
100 | #include <mach/clock_types.h> | |
101 | #include <mach/vm_attributes.h> | |
102 | #include <mach/vm_inherit.h> | |
91447636 | 103 | #include <mach/vm_purgable.h> |
1c79356b A |
104 | #include <mach/vm_behavior.h> |
105 | #include <mach/vm_prot.h> | |
106 | #include <mach/vm_statistics.h> | |
107 | #include <mach/vm_sync.h> | |
108 | #include <mach/vm_types.h> | |
109 | #include <mach/vm_region.h> | |
110 | #include <mach/kmod.h> | |
39037602 | 111 | #include <mach/dyld_kernel.h> |
1c79356b | 112 | |
0a7de745 | 113 | #ifdef KERNEL |
1c79356b A |
114 | |
115 | #include <mach/vm_param.h> | |
116 | ||
117 | /* | |
118 | * If we are in the kernel, then pick up the kernel definitions for | |
119 | * the basic mach types. | |
120 | */ | |
f427ee49 A |
121 | typedef struct task *task_t, *task_name_t, *task_inspect_t, *task_read_t, *task_suspension_token_t, *task_policy_set_t, *task_policy_get_t; |
122 | typedef struct thread *thread_t, *thread_act_t, *thread_inspect_t, *thread_read_t; | |
123 | typedef struct ipc_space *ipc_space_t, *ipc_space_read_t, *ipc_space_inspect_t; | |
0a7de745 A |
124 | typedef struct coalition *coalition_t; |
125 | typedef struct host *host_t; | |
126 | typedef struct host *host_priv_t; | |
127 | typedef struct host *host_security_t; | |
128 | typedef struct processor *processor_t; | |
129 | typedef struct processor_set *processor_set_t; | |
130 | typedef struct processor_set *processor_set_control_t; | |
131 | typedef struct semaphore *semaphore_t; | |
132 | typedef struct ledger *ledger_t; | |
133 | typedef struct alarm *alarm_t; | |
134 | typedef struct clock *clock_serv_t; | |
135 | typedef struct clock *clock_ctrl_t; | |
cb323159 | 136 | typedef struct arcade_register *arcade_register_t; |
f427ee49 A |
137 | typedef struct ipc_eventlink *ipc_eventlink_t; |
138 | typedef struct ipc_port *eventlink_port_pair_t[2]; | |
139 | typedef struct suid_cred *suid_cred_t; | |
c3c9b80d | 140 | typedef struct task_id_token *task_id_token_t; |
fe8ab488 | 141 | |
39236c6e A |
142 | /* |
143 | * OBSOLETE: lock_set interfaces are obsolete. | |
144 | */ | |
0a7de745 A |
145 | typedef struct lock_set *lock_set_t; |
146 | struct lock_set; | |
39236c6e | 147 | |
0a7de745 | 148 | #ifndef MACH_KERNEL_PRIVATE |
91447636 A |
149 | |
150 | __BEGIN_DECLS | |
9bccf70c | 151 | |
0a7de745 A |
152 | struct task; |
153 | struct thread; | |
154 | struct host; | |
155 | struct processor; | |
156 | struct processor_set; | |
157 | struct semaphore; | |
158 | struct ledger; | |
159 | struct alarm; | |
160 | struct clock; | |
cb323159 | 161 | struct arcade_register; |
f427ee49 A |
162 | struct ipc_eventlink; |
163 | struct ipc_port; | |
ea3f0419 | 164 | struct suid_cred; |
cb323159 | 165 | |
91447636 | 166 | __END_DECLS |
1c79356b | 167 | |
0a7de745 | 168 | #endif /* MACH_KERNEL_PRIVATE */ |
91447636 | 169 | |
0a7de745 | 170 | #else /* KERNEL */ |
1c79356b A |
171 | |
172 | /* | |
173 | * If we are not in the kernel, then these will all be represented by | |
174 | * ports at user-space. | |
175 | */ | |
0a7de745 A |
176 | typedef mach_port_t task_t; |
177 | typedef mach_port_t task_name_t; | |
f427ee49 A |
178 | typedef mach_port_t task_policy_set_t; |
179 | typedef mach_port_t task_policy_get_t; | |
0a7de745 | 180 | typedef mach_port_t task_inspect_t; |
f427ee49 | 181 | typedef mach_port_t task_read_t; |
0a7de745 A |
182 | typedef mach_port_t task_suspension_token_t; |
183 | typedef mach_port_t thread_t; | |
184 | typedef mach_port_t thread_act_t; | |
185 | typedef mach_port_t thread_inspect_t; | |
f427ee49 | 186 | typedef mach_port_t thread_read_t; |
0a7de745 | 187 | typedef mach_port_t ipc_space_t; |
f427ee49 | 188 | typedef mach_port_t ipc_space_read_t; |
0a7de745 A |
189 | typedef mach_port_t ipc_space_inspect_t; |
190 | typedef mach_port_t coalition_t; | |
191 | typedef mach_port_t host_t; | |
192 | typedef mach_port_t host_priv_t; | |
193 | typedef mach_port_t host_security_t; | |
194 | typedef mach_port_t processor_t; | |
195 | typedef mach_port_t processor_set_t; | |
196 | typedef mach_port_t processor_set_control_t; | |
197 | typedef mach_port_t semaphore_t; | |
198 | typedef mach_port_t lock_set_t; | |
199 | typedef mach_port_t ledger_t; | |
200 | typedef mach_port_t alarm_t; | |
201 | typedef mach_port_t clock_serv_t; | |
202 | typedef mach_port_t clock_ctrl_t; | |
cb323159 | 203 | typedef mach_port_t arcade_register_t; |
f427ee49 A |
204 | typedef mach_port_t ipc_eventlink_t; |
205 | typedef mach_port_t eventlink_port_pair_t[2]; | |
ea3f0419 | 206 | typedef mach_port_t suid_cred_t; |
c3c9b80d | 207 | typedef mach_port_t task_id_token_t; |
ea3f0419 | 208 | |
0a7de745 | 209 | #endif /* KERNEL */ |
1c79356b | 210 | |
9bccf70c A |
211 | /* |
212 | * These aren't really unique types. They are just called | |
213 | * out as unique types at one point in history. So we list | |
214 | * them here for compatibility. | |
215 | */ | |
0a7de745 | 216 | typedef processor_set_t processor_set_name_t; |
1c79356b A |
217 | |
218 | /* | |
91447636 | 219 | * These types are just hard-coded as ports |
1c79356b | 220 | */ |
0a7de745 A |
221 | typedef mach_port_t clock_reply_t; |
222 | typedef mach_port_t bootstrap_t; | |
223 | typedef mach_port_t mem_entry_name_port_t; | |
224 | typedef mach_port_t exception_handler_t; | |
225 | typedef exception_handler_t *exception_handler_array_t; | |
226 | typedef mach_port_t vm_task_entry_t; | |
227 | typedef mach_port_t io_master_t; | |
228 | typedef mach_port_t UNDServerRef; | |
f427ee49 | 229 | typedef mach_port_t mach_eventlink_t; |
1c79356b | 230 | |
c3c9b80d A |
231 | typedef ipc_info_port_t exception_handler_info_t; |
232 | ||
1c79356b | 233 | /* |
91447636 | 234 | * Mig doesn't translate the components of an array. |
1c79356b A |
235 | * For example, Mig won't use the thread_t translations |
236 | * to translate a thread_array_t argument. So, these definitions | |
237 | * are not completely accurate at the moment for other kernel | |
91447636 | 238 | * components. |
1c79356b | 239 | */ |
0a7de745 A |
240 | typedef task_t *task_array_t; |
241 | typedef thread_t *thread_array_t; | |
242 | typedef processor_set_t *processor_set_array_t; | |
243 | typedef processor_set_t *processor_set_name_array_t; | |
244 | typedef processor_t *processor_array_t; | |
245 | typedef thread_act_t *thread_act_array_t; | |
246 | typedef ledger_t *ledger_array_t; | |
1c79356b A |
247 | |
248 | /* | |
249 | * However the real mach_types got declared, we also have to declare | |
250 | * types with "port" in the name for compatability with the way OSF | |
251 | * had declared the user interfaces at one point. Someday these should | |
252 | * go away. | |
253 | */ | |
0a7de745 A |
254 | typedef task_t task_port_t; |
255 | typedef task_array_t task_port_array_t; | |
256 | typedef thread_t thread_port_t; | |
257 | typedef thread_array_t thread_port_array_t; | |
258 | typedef ipc_space_t ipc_space_port_t; | |
259 | typedef host_t host_name_t; | |
260 | typedef host_t host_name_port_t; | |
261 | typedef processor_set_t processor_set_port_t; | |
262 | typedef processor_set_t processor_set_name_port_t; | |
263 | typedef processor_set_array_t processor_set_name_port_array_t; | |
264 | typedef processor_set_t processor_set_control_port_t; | |
265 | typedef processor_t processor_port_t; | |
266 | typedef processor_array_t processor_port_array_t; | |
267 | typedef thread_act_t thread_act_port_t; | |
268 | typedef thread_act_array_t thread_act_port_array_t; | |
269 | typedef semaphore_t semaphore_port_t; | |
270 | typedef lock_set_t lock_set_port_t; | |
271 | typedef ledger_t ledger_port_t; | |
272 | typedef ledger_array_t ledger_port_array_t; | |
273 | typedef alarm_t alarm_port_t; | |
274 | typedef clock_serv_t clock_serv_port_t; | |
275 | typedef clock_ctrl_t clock_ctrl_port_t; | |
276 | typedef exception_handler_t exception_port_t; | |
1c79356b | 277 | typedef exception_handler_array_t exception_port_arrary_t; |
cb323159 A |
278 | typedef char vfs_path_t[4096]; |
279 | typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */ | |
ea3f0419 A |
280 | typedef char suid_cred_path_t[1024]; |
281 | typedef uint32_t suid_cred_uid_t; | |
1c79356b | 282 | |
cb323159 A |
283 | #ifdef KERNEL |
284 | #define TASK_NULL ((task_t) NULL) | |
285 | #define TASK_NAME_NULL ((task_name_t) NULL) | |
f427ee49 A |
286 | #define TASK_INSPECT_NULL ((task_inspect_t) NULL) |
287 | #define TASK_READ_NULL ((task_read_t) NULL) | |
cb323159 A |
288 | #define THREAD_NULL ((thread_t) NULL) |
289 | #define THREAD_INSPECT_NULL ((thread_inspect_t)NULL) | |
f427ee49 | 290 | #define THREAD_READ_NULL ((thread_read_t)NULL) |
cb323159 A |
291 | #define TID_NULL ((uint64_t) NULL) |
292 | #define THR_ACT_NULL ((thread_act_t) NULL) | |
293 | #define IPC_SPACE_NULL ((ipc_space_t) NULL) | |
f427ee49 | 294 | #define IPC_SPACE_READ_NULL ((ipc_space_read_t) NULL) |
cb323159 A |
295 | #define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) NULL) |
296 | #define COALITION_NULL ((coalition_t) NULL) | |
297 | #define HOST_NULL ((host_t) NULL) | |
298 | #define HOST_PRIV_NULL ((host_priv_t)NULL) | |
299 | #define HOST_SECURITY_NULL ((host_security_t)NULL) | |
300 | #define PROCESSOR_SET_NULL ((processor_set_t) NULL) | |
301 | #define PROCESSOR_NULL ((processor_t) NULL) | |
302 | #define SEMAPHORE_NULL ((semaphore_t) NULL) | |
303 | #define LOCK_SET_NULL ((lock_set_t) NULL) | |
304 | #define LEDGER_NULL ((ledger_t) NULL) | |
305 | #define ALARM_NULL ((alarm_t) NULL) | |
306 | #define CLOCK_NULL ((clock_t) NULL) | |
307 | #define UND_SERVER_NULL ((UNDServerRef) NULL) | |
308 | #define ARCADE_REG_NULL ((arcade_register_t) NULL) | |
f427ee49 A |
309 | #define MACH_EVENTLINK_NULL ((mach_eventlink_t) 0) |
310 | #define IPC_EVENTLINK_NULL ((ipc_eventlink_t) NULL) | |
311 | #define SUID_CRED_NULL ((suid_cred_t) NULL) | |
c3c9b80d | 312 | #define TASK_ID_TOKEN_NULL ((task_id_token_t) NULL) |
cb323159 | 313 | #else |
0a7de745 A |
314 | #define TASK_NULL ((task_t) 0) |
315 | #define TASK_NAME_NULL ((task_name_t) 0) | |
f427ee49 A |
316 | #define TASK_INSPECT_NULL ((task_inspect_t) 0) |
317 | #define TASK_READ_NULL ((task_read_t) 0) | |
0a7de745 | 318 | #define THREAD_NULL ((thread_t) 0) |
cb323159 | 319 | #define THREAD_INSPECT_NULL ((thread_inspect_t) 0) |
f427ee49 | 320 | #define THREAD_READ_NULL ((thread_read_t) 0) |
0a7de745 A |
321 | #define TID_NULL ((uint64_t) 0) |
322 | #define THR_ACT_NULL ((thread_act_t) 0) | |
323 | #define IPC_SPACE_NULL ((ipc_space_t) 0) | |
f427ee49 | 324 | #define IPC_SPACE_READ_NULL ((ipc_space_read_t) 0) |
0a7de745 A |
325 | #define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) 0) |
326 | #define COALITION_NULL ((coalition_t) 0) | |
327 | #define HOST_NULL ((host_t) 0) | |
cb323159 A |
328 | #define HOST_PRIV_NULL ((host_priv_t) 0) |
329 | #define HOST_SECURITY_NULL ((host_security_t) 0) | |
0a7de745 A |
330 | #define PROCESSOR_SET_NULL ((processor_set_t) 0) |
331 | #define PROCESSOR_NULL ((processor_t) 0) | |
332 | #define SEMAPHORE_NULL ((semaphore_t) 0) | |
333 | #define LOCK_SET_NULL ((lock_set_t) 0) | |
334 | #define LEDGER_NULL ((ledger_t) 0) | |
335 | #define ALARM_NULL ((alarm_t) 0) | |
336 | #define CLOCK_NULL ((clock_t) 0) | |
337 | #define UND_SERVER_NULL ((UNDServerRef) 0) | |
cb323159 | 338 | #define ARCADE_REG_NULL ((arcade_register_t) 0) |
f427ee49 A |
339 | #define MACH_EVENTLINK_NULL ((mach_eventlink_t) 0) |
340 | #define IPC_EVENTLINK_NULL ((ipc_eventlink_t) 0) | |
341 | #define SUID_CRED_NULL ((suid_cred_t) 0) | |
c3c9b80d | 342 | #define TASK_ID_TOKEN_NULL ((task_id_token_t) 0) |
cb323159 | 343 | #endif |
1c79356b | 344 | |
f427ee49 A |
345 | /* capability strictly _DECREASING_. |
346 | * not ordered the other way around because we want TASK_FLAVOR_CONTROL | |
347 | * to be closest to the itk_lock. see task.h. | |
348 | */ | |
349 | typedef unsigned int mach_task_flavor_t; | |
c3c9b80d | 350 | #define TASK_FLAVOR_CONTROL 0 /* a task_t */ |
f427ee49 A |
351 | #define TASK_FLAVOR_READ 1 /* a task_read_t */ |
352 | #define TASK_FLAVOR_INSPECT 2 /* a task_inspect_t */ | |
353 | #define TASK_FLAVOR_NAME 3 /* a task_name_t */ | |
354 | ||
355 | /* capability strictly _DECREASING_ */ | |
356 | typedef unsigned int mach_thread_flavor_t; | |
c3c9b80d | 357 | #define THREAD_FLAVOR_CONTROL 0 /* a thread_t */ |
f427ee49 A |
358 | #define THREAD_FLAVOR_READ 1 /* a thread_read_t */ |
359 | #define THREAD_FLAVOR_INSPECT 2 /* a thread_inspect_t */ | |
360 | ||
316670eb | 361 | /* DEPRECATED */ |
c3c9b80d | 362 | typedef natural_t ledger_item_t; |
0a7de745 | 363 | #define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0)) |
316670eb | 364 | |
0a7de745 | 365 | typedef int64_t ledger_amount_t; |
39236c6e | 366 | #define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1)) |
91447636 | 367 | |
0a7de745 A |
368 | typedef mach_vm_offset_t *emulation_vector_t; |
369 | typedef char *user_subsystem_t; | |
1c79356b | 370 | |
0a7de745 | 371 | typedef char *labelstr_t; |
1c79356b A |
372 | /* |
373 | * Backwards compatibility, for those programs written | |
374 | * before mach/{std,mach}_types.{defs,h} were set up. | |
375 | */ | |
376 | #include <mach/std_types.h> | |
377 | ||
0a7de745 | 378 | #endif /* _MACH_MACH_TYPES_H_ */ |