]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
cb323159 | 2 | * Copyright (c) 2000-2019 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,1987 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 | */ | |
58 | /* | |
59 | * Definitions of general Mach system traps. | |
60 | * | |
91447636 A |
61 | * These are the definitions as seen from user-space. |
62 | * The kernel definitions are in <mach/syscall_sw.h>. | |
1c79356b A |
63 | * Kernel RPC functions are defined in <mach/mach_interface.h>. |
64 | */ | |
65 | ||
0a7de745 | 66 | #ifndef _MACH_MACH_TRAPS_H_ |
1c79356b A |
67 | #define _MACH_MACH_TRAPS_H_ |
68 | ||
91447636 A |
69 | #include <stdint.h> |
70 | ||
71 | #include <mach/std_types.h> | |
72 | #include <mach/mach_types.h> | |
1c79356b A |
73 | #include <mach/kern_return.h> |
74 | #include <mach/port.h> | |
75 | #include <mach/vm_types.h> | |
76 | #include <mach/clock_types.h> | |
1c79356b | 77 | |
91447636 A |
78 | #include <machine/endian.h> |
79 | ||
80 | #include <sys/cdefs.h> | |
81 | ||
82 | __BEGIN_DECLS | |
83 | ||
0a7de745 | 84 | #ifndef KERNEL |
91447636 | 85 | |
0a7de745 | 86 | #ifdef PRIVATE |
1c79356b | 87 | |
91447636 | 88 | extern mach_port_name_t mach_reply_port(void); |
1c79356b | 89 | |
5ba3f43e A |
90 | extern mach_port_name_t thread_get_special_reply_port(void); |
91 | ||
91447636 | 92 | extern mach_port_name_t thread_self_trap(void); |
1c79356b | 93 | |
91447636 | 94 | extern mach_port_name_t host_self_trap(void); |
1c79356b | 95 | |
91447636 | 96 | extern mach_msg_return_t mach_msg_trap( |
0a7de745 A |
97 | mach_msg_header_t *msg, |
98 | mach_msg_option_t option, | |
99 | mach_msg_size_t send_size, | |
100 | mach_msg_size_t rcv_size, | |
101 | mach_port_name_t rcv_name, | |
102 | mach_msg_timeout_t timeout, | |
103 | mach_port_name_t notify); | |
91447636 A |
104 | |
105 | extern mach_msg_return_t mach_msg_overwrite_trap( | |
0a7de745 A |
106 | mach_msg_header_t *msg, |
107 | mach_msg_option_t option, | |
108 | mach_msg_size_t send_size, | |
109 | mach_msg_size_t rcv_size, | |
110 | mach_port_name_t rcv_name, | |
111 | mach_msg_timeout_t timeout, | |
f427ee49 | 112 | mach_msg_priority_t priority, |
0a7de745 A |
113 | mach_msg_header_t *rcv_msg, |
114 | mach_msg_size_t rcv_limit); | |
91447636 A |
115 | |
116 | extern kern_return_t semaphore_signal_trap( | |
0a7de745 A |
117 | mach_port_name_t signal_name); |
118 | ||
91447636 | 119 | extern kern_return_t semaphore_signal_all_trap( |
0a7de745 | 120 | mach_port_name_t signal_name); |
1c79356b | 121 | |
91447636 | 122 | extern kern_return_t semaphore_signal_thread_trap( |
0a7de745 A |
123 | mach_port_name_t signal_name, |
124 | mach_port_name_t thread_name); | |
1c79356b | 125 | |
91447636 | 126 | extern kern_return_t semaphore_wait_trap( |
0a7de745 | 127 | mach_port_name_t wait_name); |
1c79356b | 128 | |
91447636 | 129 | extern kern_return_t semaphore_wait_signal_trap( |
0a7de745 A |
130 | mach_port_name_t wait_name, |
131 | mach_port_name_t signal_name); | |
1c79356b | 132 | |
91447636 | 133 | extern kern_return_t semaphore_timedwait_trap( |
0a7de745 A |
134 | mach_port_name_t wait_name, |
135 | unsigned int sec, | |
136 | clock_res_t nsec); | |
1c79356b | 137 | |
91447636 | 138 | extern kern_return_t semaphore_timedwait_signal_trap( |
0a7de745 A |
139 | mach_port_name_t wait_name, |
140 | mach_port_name_t signal_name, | |
141 | unsigned int sec, | |
142 | clock_res_t nsec); | |
1c79356b | 143 | |
0a7de745 | 144 | #endif /* PRIVATE */ |
316670eb | 145 | |
b0d623f7 | 146 | extern kern_return_t clock_sleep_trap( |
0a7de745 A |
147 | mach_port_name_t clock_name, |
148 | sleep_type_t sleep_type, | |
149 | int sleep_sec, | |
150 | int sleep_nsec, | |
151 | mach_timespec_t *wakeup_time); | |
91447636 | 152 | |
316670eb | 153 | extern kern_return_t _kernelrpc_mach_vm_allocate_trap( |
0a7de745 A |
154 | mach_port_name_t target, |
155 | mach_vm_offset_t *addr, | |
156 | mach_vm_size_t size, | |
157 | int flags); | |
316670eb A |
158 | |
159 | extern kern_return_t _kernelrpc_mach_vm_deallocate_trap( | |
0a7de745 A |
160 | mach_port_name_t target, |
161 | mach_vm_address_t address, | |
162 | mach_vm_size_t size | |
163 | ); | |
316670eb A |
164 | |
165 | extern kern_return_t _kernelrpc_mach_vm_protect_trap( | |
0a7de745 A |
166 | mach_port_name_t target, |
167 | mach_vm_address_t address, | |
168 | mach_vm_size_t size, | |
169 | boolean_t set_maximum, | |
170 | vm_prot_t new_protection | |
171 | ); | |
316670eb | 172 | |
39236c6e | 173 | extern kern_return_t _kernelrpc_mach_vm_map_trap( |
0a7de745 A |
174 | mach_port_name_t target, |
175 | mach_vm_offset_t *address, | |
176 | mach_vm_size_t size, | |
177 | mach_vm_offset_t mask, | |
178 | int flags, | |
179 | vm_prot_t cur_protection | |
180 | ); | |
39236c6e | 181 | |
39037602 | 182 | extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap( |
0a7de745 A |
183 | mach_port_name_t target, |
184 | mach_vm_offset_t address, | |
185 | vm_purgable_t control, | |
186 | int *state); | |
39037602 | 187 | |
316670eb | 188 | extern kern_return_t _kernelrpc_mach_port_allocate_trap( |
0a7de745 A |
189 | mach_port_name_t target, |
190 | mach_port_right_t right, | |
191 | mach_port_name_t *name | |
192 | ); | |
316670eb | 193 | |
316670eb | 194 | extern kern_return_t _kernelrpc_mach_port_deallocate_trap( |
0a7de745 A |
195 | mach_port_name_t target, |
196 | mach_port_name_t name | |
197 | ); | |
316670eb A |
198 | |
199 | extern kern_return_t _kernelrpc_mach_port_mod_refs_trap( | |
0a7de745 A |
200 | mach_port_name_t target, |
201 | mach_port_name_t name, | |
202 | mach_port_right_t right, | |
203 | mach_port_delta_t delta | |
204 | ); | |
316670eb A |
205 | |
206 | extern kern_return_t _kernelrpc_mach_port_move_member_trap( | |
0a7de745 A |
207 | mach_port_name_t target, |
208 | mach_port_name_t member, | |
209 | mach_port_name_t after | |
210 | ); | |
316670eb A |
211 | |
212 | extern kern_return_t _kernelrpc_mach_port_insert_right_trap( | |
0a7de745 A |
213 | mach_port_name_t target, |
214 | mach_port_name_t name, | |
215 | mach_port_name_t poly, | |
216 | mach_msg_type_name_t polyPoly | |
217 | ); | |
316670eb | 218 | |
d9a64523 | 219 | extern kern_return_t _kernelrpc_mach_port_get_attributes_trap( |
0a7de745 A |
220 | mach_port_name_t target, |
221 | mach_port_name_t name, | |
222 | mach_port_flavor_t flavor, | |
223 | mach_port_info_t port_info_out, | |
224 | mach_msg_type_number_t *port_info_outCnt | |
225 | ); | |
d9a64523 | 226 | |
316670eb | 227 | extern kern_return_t _kernelrpc_mach_port_insert_member_trap( |
0a7de745 A |
228 | mach_port_name_t target, |
229 | mach_port_name_t name, | |
230 | mach_port_name_t pset | |
231 | ); | |
316670eb A |
232 | |
233 | extern kern_return_t _kernelrpc_mach_port_extract_member_trap( | |
0a7de745 A |
234 | mach_port_name_t target, |
235 | mach_port_name_t name, | |
236 | mach_port_name_t pset | |
237 | ); | |
91447636 | 238 | |
39236c6e | 239 | extern kern_return_t _kernelrpc_mach_port_construct_trap( |
0a7de745 A |
240 | mach_port_name_t target, |
241 | mach_port_options_t *options, | |
242 | uint64_t context, | |
243 | mach_port_name_t *name | |
244 | ); | |
39236c6e A |
245 | |
246 | extern kern_return_t _kernelrpc_mach_port_destruct_trap( | |
0a7de745 A |
247 | mach_port_name_t target, |
248 | mach_port_name_t name, | |
249 | mach_port_delta_t srdelta, | |
250 | uint64_t guard | |
251 | ); | |
39236c6e A |
252 | |
253 | extern kern_return_t _kernelrpc_mach_port_guard_trap( | |
0a7de745 A |
254 | mach_port_name_t target, |
255 | mach_port_name_t name, | |
256 | uint64_t guard, | |
257 | boolean_t strict | |
258 | ); | |
39236c6e A |
259 | |
260 | extern kern_return_t _kernelrpc_mach_port_unguard_trap( | |
0a7de745 A |
261 | mach_port_name_t target, |
262 | mach_port_name_t name, | |
263 | uint64_t guard | |
264 | ); | |
39236c6e | 265 | |
39037602 | 266 | extern kern_return_t mach_generate_activity_id( |
0a7de745 A |
267 | mach_port_name_t target, |
268 | int count, | |
269 | uint64_t *activity_id | |
270 | ); | |
39037602 | 271 | |
91447636 | 272 | extern kern_return_t macx_swapon( |
0a7de745 A |
273 | uint64_t filename, |
274 | int flags, | |
275 | int size, | |
276 | int priority); | |
91447636 A |
277 | |
278 | extern kern_return_t macx_swapoff( | |
0a7de745 A |
279 | uint64_t filename, |
280 | int flags); | |
91447636 A |
281 | |
282 | extern kern_return_t macx_triggers( | |
0a7de745 A |
283 | int hi_water, |
284 | int low_water, | |
285 | int flags, | |
286 | mach_port_t alert_port); | |
91447636 A |
287 | |
288 | extern kern_return_t macx_backing_store_suspend( | |
0a7de745 | 289 | boolean_t suspend); |
91447636 A |
290 | |
291 | extern kern_return_t macx_backing_store_recovery( | |
0a7de745 | 292 | int pid); |
91447636 | 293 | |
91447636 A |
294 | extern boolean_t swtch_pri(int pri); |
295 | ||
296 | extern boolean_t swtch(void); | |
297 | ||
298 | extern kern_return_t thread_switch( | |
0a7de745 A |
299 | mach_port_name_t thread_name, |
300 | int option, | |
301 | mach_msg_timeout_t option_time); | |
91447636 A |
302 | |
303 | extern mach_port_name_t task_self_trap(void); | |
304 | ||
39037602 | 305 | extern kern_return_t host_create_mach_voucher_trap( |
0a7de745 A |
306 | mach_port_name_t host, |
307 | mach_voucher_attr_raw_recipe_array_t recipes, | |
308 | int recipes_size, | |
309 | mach_port_name_t *voucher); | |
39037602 A |
310 | |
311 | extern kern_return_t mach_voucher_extract_attr_recipe_trap( | |
0a7de745 A |
312 | mach_port_name_t voucher_name, |
313 | mach_voucher_attr_key_t key, | |
314 | mach_voucher_attr_raw_recipe_t recipe, | |
315 | mach_msg_type_number_t *recipe_size); | |
39037602 | 316 | |
cb323159 A |
317 | extern kern_return_t _kernelrpc_mach_port_type_trap( |
318 | ipc_space_t task, | |
319 | mach_port_name_t name, | |
320 | mach_port_type_t *ptype); | |
321 | ||
322 | extern kern_return_t _kernelrpc_mach_port_request_notification_trap( | |
323 | ipc_space_t task, | |
324 | mach_port_name_t name, | |
325 | mach_msg_id_t msgid, | |
326 | mach_port_mscount_t sync, | |
327 | mach_port_name_t notify, | |
328 | mach_msg_type_name_t notifyPoly, | |
329 | mach_port_name_t *previous); | |
330 | ||
91447636 A |
331 | /* |
332 | * Obsolete interfaces. | |
333 | */ | |
334 | ||
335 | extern kern_return_t task_for_pid( | |
0a7de745 A |
336 | mach_port_name_t target_tport, |
337 | int pid, | |
338 | mach_port_name_t *t); | |
91447636 | 339 | |
0c530ab8 | 340 | extern kern_return_t task_name_for_pid( |
0a7de745 A |
341 | mach_port_name_t target_tport, |
342 | int pid, | |
343 | mach_port_name_t *tn); | |
0c530ab8 | 344 | |
91447636 | 345 | extern kern_return_t pid_for_task( |
0a7de745 A |
346 | mach_port_name_t t, |
347 | int *x); | |
91447636 | 348 | |
cb323159 A |
349 | extern kern_return_t debug_control_port_for_pid( |
350 | mach_port_name_t target_tport, | |
351 | int pid, | |
352 | mach_port_name_t *t); | |
353 | ||
0a7de745 | 354 | #else /* KERNEL */ |
91447636 | 355 | |
0a7de745 | 356 | #ifdef XNU_KERNEL_PRIVATE |
91447636 | 357 | |
6d2010ae A |
358 | /* Syscall data translations routines |
359 | * | |
360 | * The kernel may support multiple userspace ABIs, and must use | |
361 | * argument structures with elements large enough for any of them. | |
362 | */ | |
fe8ab488 | 363 | #if CONFIG_REQUIRES_U32_MUNGING |
0a7de745 A |
364 | #define PAD_(t) (sizeof(uint64_t) <= sizeof(t) \ |
365 | ? 0 : sizeof(uint64_t) - sizeof(t)) | |
2d21ac55 | 366 | #define PAD_ARG_8 |
fe8ab488 | 367 | #else |
0a7de745 A |
368 | #define PAD_(t) (sizeof(uint32_t) <= sizeof(t) \ |
369 | ? 0 : sizeof(uint32_t) - sizeof(t)) | |
5ba3f43e A |
370 | #if __arm__ && (__BIGGEST_ALIGNMENT__ > 4) |
371 | #define PAD_ARG_8 | |
372 | #else | |
fe8ab488 A |
373 | #define PAD_ARG_8 char arg8_pad_[sizeof(uint32_t)]; |
374 | #endif | |
5ba3f43e | 375 | #endif |
91447636 A |
376 | |
377 | #if BYTE_ORDER == LITTLE_ENDIAN | |
0a7de745 A |
378 | #define PADL_(t) 0 |
379 | #define PADR_(t) PAD_(t) | |
91447636 | 380 | #else |
0a7de745 A |
381 | #define PADL_(t) PAD_(t) |
382 | #define PADR_(t) 0 | |
91447636 A |
383 | #endif |
384 | ||
385 | #define PAD_ARG_(arg_type, arg_name) \ | |
cb323159 | 386 | char arg_name##_l_[PADL_(arg_type)]; arg_type arg_name; char arg_name##_r_[PADR_(arg_type)] |
91447636 | 387 | |
6d2010ae A |
388 | /* |
389 | * To support 32-bit clients as well as 64-bit clients, argument | |
390 | * structures may need to be munged to repack the arguments. All | |
391 | * active architectures do this inline in the code to dispatch Mach | |
392 | * traps, without calling out to the BSD system call mungers. | |
393 | */ | |
394 | ||
91447636 | 395 | struct kern_invalid_args { |
b0d623f7 | 396 | int32_t dummy; |
91447636 A |
397 | }; |
398 | extern kern_return_t kern_invalid( | |
0a7de745 | 399 | struct kern_invalid_args *args); |
91447636 A |
400 | |
401 | struct mach_reply_port_args { | |
b0d623f7 | 402 | int32_t dummy; |
91447636 A |
403 | }; |
404 | extern mach_port_name_t mach_reply_port( | |
0a7de745 | 405 | struct mach_reply_port_args *args); |
91447636 | 406 | |
5ba3f43e A |
407 | struct thread_get_special_reply_port_args { |
408 | int32_t dummy; | |
409 | }; | |
410 | extern mach_port_name_t thread_get_special_reply_port( | |
0a7de745 | 411 | struct thread_get_special_reply_port_args *args); |
5ba3f43e | 412 | |
91447636 | 413 | struct thread_self_trap_args { |
b0d623f7 | 414 | int32_t dummy; |
91447636 A |
415 | }; |
416 | extern mach_port_name_t thread_self_trap( | |
0a7de745 | 417 | struct thread_self_trap_args *args); |
91447636 A |
418 | |
419 | struct task_self_trap_args { | |
b0d623f7 | 420 | int32_t dummy; |
91447636 A |
421 | }; |
422 | extern mach_port_name_t task_self_trap( | |
0a7de745 | 423 | struct task_self_trap_args *args); |
91447636 A |
424 | |
425 | struct host_self_trap_args { | |
b0d623f7 | 426 | int32_t dummy; |
91447636 A |
427 | }; |
428 | extern mach_port_name_t host_self_trap( | |
0a7de745 | 429 | struct host_self_trap_args *args); |
91447636 A |
430 | |
431 | struct mach_msg_overwrite_trap_args { | |
316670eb | 432 | PAD_ARG_(user_addr_t, msg); |
91447636 A |
433 | PAD_ARG_(mach_msg_option_t, option); |
434 | PAD_ARG_(mach_msg_size_t, send_size); | |
435 | PAD_ARG_(mach_msg_size_t, rcv_size); | |
436 | PAD_ARG_(mach_port_name_t, rcv_name); | |
437 | PAD_ARG_(mach_msg_timeout_t, timeout); | |
f427ee49 | 438 | PAD_ARG_(mach_msg_priority_t, priority); |
2d21ac55 | 439 | PAD_ARG_8 |
0a7de745 | 440 | PAD_ARG_(user_addr_t, rcv_msg); /* Unused on mach_msg_trap */ |
91447636 A |
441 | }; |
442 | extern mach_msg_return_t mach_msg_trap( | |
0a7de745 | 443 | struct mach_msg_overwrite_trap_args *args); |
91447636 | 444 | extern mach_msg_return_t mach_msg_overwrite_trap( |
0a7de745 | 445 | struct mach_msg_overwrite_trap_args *args); |
91447636 A |
446 | |
447 | struct semaphore_signal_trap_args { | |
448 | PAD_ARG_(mach_port_name_t, signal_name); | |
449 | }; | |
450 | extern kern_return_t semaphore_signal_trap( | |
0a7de745 A |
451 | struct semaphore_signal_trap_args *args); |
452 | ||
91447636 A |
453 | struct semaphore_signal_all_trap_args { |
454 | PAD_ARG_(mach_port_name_t, signal_name); | |
455 | }; | |
456 | extern kern_return_t semaphore_signal_all_trap( | |
0a7de745 | 457 | struct semaphore_signal_all_trap_args *args); |
91447636 A |
458 | |
459 | struct semaphore_signal_thread_trap_args { | |
460 | PAD_ARG_(mach_port_name_t, signal_name); | |
461 | PAD_ARG_(mach_port_name_t, thread_name); | |
462 | }; | |
463 | extern kern_return_t semaphore_signal_thread_trap( | |
0a7de745 | 464 | struct semaphore_signal_thread_trap_args *args); |
91447636 A |
465 | |
466 | struct semaphore_wait_trap_args { | |
467 | PAD_ARG_(mach_port_name_t, wait_name); | |
468 | }; | |
469 | extern kern_return_t semaphore_wait_trap( | |
0a7de745 | 470 | struct semaphore_wait_trap_args *args); |
91447636 A |
471 | |
472 | struct semaphore_wait_signal_trap_args { | |
473 | PAD_ARG_(mach_port_name_t, wait_name); | |
474 | PAD_ARG_(mach_port_name_t, signal_name); | |
475 | }; | |
476 | extern kern_return_t semaphore_wait_signal_trap( | |
0a7de745 | 477 | struct semaphore_wait_signal_trap_args *args); |
91447636 A |
478 | |
479 | struct semaphore_timedwait_trap_args { | |
480 | PAD_ARG_(mach_port_name_t, wait_name); | |
481 | PAD_ARG_(unsigned int, sec); | |
482 | PAD_ARG_(clock_res_t, nsec); | |
483 | }; | |
484 | extern kern_return_t semaphore_timedwait_trap( | |
0a7de745 | 485 | struct semaphore_timedwait_trap_args *args); |
91447636 A |
486 | |
487 | struct semaphore_timedwait_signal_trap_args { | |
488 | PAD_ARG_(mach_port_name_t, wait_name); | |
489 | PAD_ARG_(mach_port_name_t, signal_name); | |
490 | PAD_ARG_(unsigned int, sec); | |
491 | PAD_ARG_(clock_res_t, nsec); | |
492 | }; | |
493 | extern kern_return_t semaphore_timedwait_signal_trap( | |
0a7de745 | 494 | struct semaphore_timedwait_signal_trap_args *args); |
91447636 | 495 | |
91447636 A |
496 | struct task_for_pid_args { |
497 | PAD_ARG_(mach_port_name_t, target_tport); | |
498 | PAD_ARG_(int, pid); | |
499 | PAD_ARG_(user_addr_t, t); | |
500 | }; | |
501 | extern kern_return_t task_for_pid( | |
0a7de745 | 502 | struct task_for_pid_args *args); |
91447636 | 503 | |
0c530ab8 A |
504 | struct task_name_for_pid_args { |
505 | PAD_ARG_(mach_port_name_t, target_tport); | |
506 | PAD_ARG_(int, pid); | |
507 | PAD_ARG_(user_addr_t, t); | |
508 | }; | |
509 | extern kern_return_t task_name_for_pid( | |
0a7de745 | 510 | struct task_name_for_pid_args *args); |
0c530ab8 | 511 | |
91447636 A |
512 | struct pid_for_task_args { |
513 | PAD_ARG_(mach_port_name_t, t); | |
514 | PAD_ARG_(user_addr_t, pid); | |
515 | }; | |
516 | extern kern_return_t pid_for_task( | |
0a7de745 | 517 | struct pid_for_task_args *args); |
91447636 | 518 | |
cb323159 A |
519 | struct debug_control_port_for_pid_args { |
520 | PAD_ARG_(mach_port_name_t, target_tport); | |
521 | PAD_ARG_(int, pid); | |
522 | PAD_ARG_(user_addr_t, t); | |
523 | }; | |
524 | extern kern_return_t debug_control_port_for_pid( | |
525 | struct debug_control_port_for_pid_args *args); | |
526 | ||
91447636 | 527 | struct macx_swapon_args { |
b0d623f7 | 528 | PAD_ARG_(uint64_t, filename); |
91447636 A |
529 | PAD_ARG_(int, flags); |
530 | PAD_ARG_(int, size); | |
531 | PAD_ARG_(int, priority); | |
532 | }; | |
533 | extern kern_return_t macx_swapon( | |
0a7de745 | 534 | struct macx_swapon_args *args); |
91447636 A |
535 | |
536 | struct macx_swapoff_args { | |
0a7de745 A |
537 | PAD_ARG_(uint64_t, filename); |
538 | PAD_ARG_(int, flags); | |
91447636 A |
539 | }; |
540 | extern kern_return_t macx_swapoff( | |
0a7de745 | 541 | struct macx_swapoff_args *args); |
91447636 A |
542 | |
543 | struct macx_triggers_args { | |
544 | PAD_ARG_(int, hi_water); | |
545 | PAD_ARG_(int, low_water); | |
546 | PAD_ARG_(int, flags); | |
547 | PAD_ARG_(mach_port_t, alert_port); | |
548 | }; | |
549 | extern kern_return_t macx_triggers( | |
0a7de745 | 550 | struct macx_triggers_args *args); |
91447636 A |
551 | |
552 | struct macx_backing_store_suspend_args { | |
553 | PAD_ARG_(boolean_t, suspend); | |
554 | }; | |
555 | extern kern_return_t macx_backing_store_suspend( | |
0a7de745 | 556 | struct macx_backing_store_suspend_args *args); |
91447636 A |
557 | |
558 | struct macx_backing_store_recovery_args { | |
559 | PAD_ARG_(int, pid); | |
560 | }; | |
561 | extern kern_return_t macx_backing_store_recovery( | |
0a7de745 | 562 | struct macx_backing_store_recovery_args *args); |
91447636 A |
563 | |
564 | struct swtch_pri_args { | |
565 | PAD_ARG_(int, pri); | |
566 | }; | |
567 | extern boolean_t swtch_pri( | |
0a7de745 | 568 | struct swtch_pri_args *args); |
91447636 | 569 | |
b0d623f7 A |
570 | struct pfz_exit_args { |
571 | int32_t dummy; | |
572 | }; | |
573 | extern kern_return_t pfz_exit( | |
0a7de745 | 574 | struct pfz_exit_args *args); |
b0d623f7 | 575 | |
91447636 | 576 | struct swtch_args { |
0a7de745 | 577 | int32_t dummy; |
91447636 A |
578 | }; |
579 | extern boolean_t swtch( | |
0a7de745 | 580 | struct swtch_args *args); |
91447636 | 581 | |
0a7de745 | 582 | struct clock_sleep_trap_args { |
91447636 A |
583 | PAD_ARG_(mach_port_name_t, clock_name); |
584 | PAD_ARG_(sleep_type_t, sleep_type); | |
585 | PAD_ARG_(int, sleep_sec); | |
586 | PAD_ARG_(int, sleep_nsec); | |
316670eb | 587 | PAD_ARG_(user_addr_t, wakeup_time); |
91447636 A |
588 | }; |
589 | extern kern_return_t clock_sleep_trap( | |
0a7de745 | 590 | struct clock_sleep_trap_args *args); |
91447636 A |
591 | |
592 | struct thread_switch_args { | |
593 | PAD_ARG_(mach_port_name_t, thread_name); | |
594 | PAD_ARG_(int, option); | |
595 | PAD_ARG_(mach_msg_timeout_t, option_time); | |
596 | }; | |
597 | extern kern_return_t thread_switch( | |
0a7de745 | 598 | struct thread_switch_args *args); |
91447636 A |
599 | |
600 | struct mach_timebase_info_trap_args { | |
316670eb | 601 | PAD_ARG_(user_addr_t, info); |
91447636 A |
602 | }; |
603 | extern kern_return_t mach_timebase_info_trap( | |
0a7de745 | 604 | struct mach_timebase_info_trap_args *args); |
91447636 A |
605 | |
606 | struct mach_wait_until_trap_args { | |
607 | PAD_ARG_(uint64_t, deadline); | |
608 | }; | |
609 | extern kern_return_t mach_wait_until_trap( | |
0a7de745 | 610 | struct mach_wait_until_trap_args *args); |
91447636 A |
611 | |
612 | struct mk_timer_create_trap_args { | |
0a7de745 | 613 | int32_t dummy; |
91447636 A |
614 | }; |
615 | extern mach_port_name_t mk_timer_create_trap( | |
0a7de745 | 616 | struct mk_timer_create_trap_args *args); |
91447636 A |
617 | |
618 | struct mk_timer_destroy_trap_args { | |
619 | PAD_ARG_(mach_port_name_t, name); | |
620 | }; | |
621 | extern kern_return_t mk_timer_destroy_trap( | |
0a7de745 | 622 | struct mk_timer_destroy_trap_args *args); |
91447636 A |
623 | |
624 | struct mk_timer_arm_trap_args { | |
625 | PAD_ARG_(mach_port_name_t, name); | |
626 | PAD_ARG_(uint64_t, expire_time); | |
627 | }; | |
628 | extern kern_return_t mk_timer_arm_trap( | |
0a7de745 | 629 | struct mk_timer_arm_trap_args *args); |
91447636 | 630 | |
813fb2f6 A |
631 | struct mk_timer_arm_leeway_trap_args { |
632 | PAD_ARG_(mach_port_name_t, name); | |
633 | PAD_ARG_(uint64_t, mk_timer_flags); | |
634 | PAD_ARG_(uint64_t, expire_time); | |
635 | PAD_ARG_(uint64_t, mk_leeway); | |
636 | }; | |
637 | extern kern_return_t mk_timer_arm_leeway_trap( | |
0a7de745 | 638 | struct mk_timer_arm_leeway_trap_args *args); |
813fb2f6 | 639 | |
91447636 | 640 | struct mk_timer_cancel_trap_args { |
0a7de745 A |
641 | PAD_ARG_(mach_port_name_t, name); |
642 | PAD_ARG_(user_addr_t, result_time); | |
91447636 A |
643 | }; |
644 | extern kern_return_t mk_timer_cancel_trap( | |
0a7de745 | 645 | struct mk_timer_cancel_trap_args *args); |
91447636 | 646 | |
316670eb | 647 | struct _kernelrpc_mach_vm_allocate_trap_args { |
0a7de745 A |
648 | PAD_ARG_(mach_port_name_t, target); /* 1 word */ |
649 | PAD_ARG_(user_addr_t, addr); /* 1 word */ | |
650 | PAD_ARG_(mach_vm_size_t, size); /* 2 words */ | |
651 | PAD_ARG_(int, flags); /* 1 word */ | |
652 | }; /* Total: 5 */ | |
316670eb A |
653 | |
654 | extern kern_return_t _kernelrpc_mach_vm_allocate_trap( | |
0a7de745 | 655 | struct _kernelrpc_mach_vm_allocate_trap_args *args); |
316670eb A |
656 | |
657 | struct _kernelrpc_mach_vm_deallocate_args { | |
0a7de745 A |
658 | PAD_ARG_(mach_port_name_t, target); /* 1 word */ |
659 | PAD_ARG_(mach_vm_address_t, address); /* 2 words */ | |
660 | PAD_ARG_(mach_vm_size_t, size); /* 2 words */ | |
661 | }; /* Total: 5 */ | |
316670eb | 662 | extern kern_return_t _kernelrpc_mach_vm_deallocate_trap( |
0a7de745 | 663 | struct _kernelrpc_mach_vm_deallocate_args *args); |
316670eb A |
664 | |
665 | struct _kernelrpc_mach_vm_protect_args { | |
0a7de745 A |
666 | PAD_ARG_(mach_port_name_t, target); /* 1 word */ |
667 | PAD_ARG_(mach_vm_address_t, address); /* 2 words */ | |
668 | PAD_ARG_(mach_vm_size_t, size); /* 2 words */ | |
669 | PAD_ARG_(boolean_t, set_maximum); /* 1 word */ | |
670 | PAD_ARG_(vm_prot_t, new_protection); /* 1 word */ | |
671 | }; /* Total: 7 */ | |
316670eb | 672 | extern kern_return_t _kernelrpc_mach_vm_protect_trap( |
0a7de745 | 673 | struct _kernelrpc_mach_vm_protect_args *args); |
316670eb | 674 | |
39236c6e A |
675 | struct _kernelrpc_mach_vm_map_trap_args { |
676 | PAD_ARG_(mach_port_name_t, target); | |
677 | PAD_ARG_(user_addr_t, addr); | |
678 | PAD_ARG_(mach_vm_size_t, size); | |
679 | PAD_ARG_(mach_vm_offset_t, mask); | |
680 | PAD_ARG_(int, flags); | |
681 | PAD_ARG_8 | |
0a7de745 | 682 | PAD_ARG_(vm_prot_t, cur_protection); |
39236c6e A |
683 | }; |
684 | extern kern_return_t _kernelrpc_mach_vm_map_trap( | |
0a7de745 | 685 | struct _kernelrpc_mach_vm_map_trap_args *args); |
39236c6e | 686 | |
39037602 | 687 | struct _kernelrpc_mach_vm_purgable_control_trap_args { |
0a7de745 A |
688 | PAD_ARG_(mach_port_name_t, target); /* 1 word */ |
689 | PAD_ARG_(mach_vm_offset_t, address); /* 2 words */ | |
690 | PAD_ARG_(vm_purgable_t, control); /* 1 word */ | |
691 | PAD_ARG_(user_addr_t, state); /* 1 word */ | |
692 | }; /* Total: 5 */ | |
39037602 A |
693 | |
694 | extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap( | |
695 | struct _kernelrpc_mach_vm_purgable_control_trap_args *args); | |
696 | ||
316670eb A |
697 | struct _kernelrpc_mach_port_allocate_args { |
698 | PAD_ARG_(mach_port_name_t, target); | |
699 | PAD_ARG_(mach_port_right_t, right); | |
700 | PAD_ARG_(user_addr_t, name); | |
701 | }; | |
702 | extern kern_return_t _kernelrpc_mach_port_allocate_trap( | |
0a7de745 | 703 | struct _kernelrpc_mach_port_allocate_args *args); |
316670eb | 704 | |
316670eb A |
705 | struct _kernelrpc_mach_port_deallocate_args { |
706 | PAD_ARG_(mach_port_name_t, target); | |
707 | PAD_ARG_(mach_port_name_t, name); | |
708 | }; | |
709 | extern kern_return_t _kernelrpc_mach_port_deallocate_trap( | |
0a7de745 | 710 | struct _kernelrpc_mach_port_deallocate_args *args); |
316670eb A |
711 | |
712 | struct _kernelrpc_mach_port_mod_refs_args { | |
713 | PAD_ARG_(mach_port_name_t, target); | |
714 | PAD_ARG_(mach_port_name_t, name); | |
715 | PAD_ARG_(mach_port_right_t, right); | |
716 | PAD_ARG_(mach_port_delta_t, delta); | |
717 | }; | |
718 | extern kern_return_t _kernelrpc_mach_port_mod_refs_trap( | |
0a7de745 | 719 | struct _kernelrpc_mach_port_mod_refs_args *args); |
316670eb A |
720 | |
721 | struct _kernelrpc_mach_port_move_member_args { | |
722 | PAD_ARG_(mach_port_name_t, target); | |
723 | PAD_ARG_(mach_port_name_t, member); | |
724 | PAD_ARG_(mach_port_name_t, after); | |
725 | }; | |
726 | extern kern_return_t _kernelrpc_mach_port_move_member_trap( | |
0a7de745 | 727 | struct _kernelrpc_mach_port_move_member_args *args); |
316670eb A |
728 | |
729 | struct _kernelrpc_mach_port_insert_right_args { | |
730 | PAD_ARG_(mach_port_name_t, target); | |
731 | PAD_ARG_(mach_port_name_t, name); | |
732 | PAD_ARG_(mach_port_name_t, poly); | |
733 | PAD_ARG_(mach_msg_type_name_t, polyPoly); | |
734 | }; | |
735 | extern kern_return_t _kernelrpc_mach_port_insert_right_trap( | |
0a7de745 | 736 | struct _kernelrpc_mach_port_insert_right_args *args); |
316670eb | 737 | |
d9a64523 A |
738 | struct _kernelrpc_mach_port_get_attributes_args { |
739 | PAD_ARG_(mach_port_name_t, target); | |
740 | PAD_ARG_(mach_port_name_t, name); | |
741 | PAD_ARG_(mach_port_flavor_t, flavor); | |
742 | PAD_ARG_(user_addr_t, info); | |
743 | PAD_ARG_(user_addr_t, count); | |
744 | }; | |
745 | extern kern_return_t _kernelrpc_mach_port_get_attributes_trap( | |
0a7de745 | 746 | struct _kernelrpc_mach_port_get_attributes_args *args); |
d9a64523 | 747 | |
316670eb A |
748 | struct _kernelrpc_mach_port_insert_member_args { |
749 | PAD_ARG_(mach_port_name_t, target); | |
750 | PAD_ARG_(mach_port_name_t, name); | |
751 | PAD_ARG_(mach_port_name_t, pset); | |
752 | }; | |
753 | extern kern_return_t _kernelrpc_mach_port_insert_member_trap( | |
0a7de745 | 754 | struct _kernelrpc_mach_port_insert_member_args *args); |
316670eb A |
755 | |
756 | struct _kernelrpc_mach_port_extract_member_args { | |
757 | PAD_ARG_(mach_port_name_t, target); | |
758 | PAD_ARG_(mach_port_name_t, name); | |
759 | PAD_ARG_(mach_port_name_t, pset); | |
760 | }; | |
761 | extern kern_return_t _kernelrpc_mach_port_extract_member_trap( | |
0a7de745 | 762 | struct _kernelrpc_mach_port_extract_member_args *args); |
316670eb | 763 | |
39236c6e A |
764 | struct _kernelrpc_mach_port_construct_args { |
765 | PAD_ARG_(mach_port_name_t, target); | |
766 | PAD_ARG_(user_addr_t, options); | |
767 | PAD_ARG_(uint64_t, context); | |
768 | PAD_ARG_(user_addr_t, name); | |
769 | }; | |
770 | extern kern_return_t _kernelrpc_mach_port_construct_trap( | |
0a7de745 | 771 | struct _kernelrpc_mach_port_construct_args *args); |
39236c6e A |
772 | |
773 | struct _kernelrpc_mach_port_destruct_args { | |
774 | PAD_ARG_(mach_port_name_t, target); | |
775 | PAD_ARG_(mach_port_name_t, name); | |
776 | PAD_ARG_(mach_port_delta_t, srdelta); | |
777 | PAD_ARG_(uint64_t, guard); | |
778 | }; | |
779 | extern kern_return_t _kernelrpc_mach_port_destruct_trap( | |
0a7de745 | 780 | struct _kernelrpc_mach_port_destruct_args *args); |
39236c6e A |
781 | |
782 | struct _kernelrpc_mach_port_guard_args { | |
783 | PAD_ARG_(mach_port_name_t, target); | |
784 | PAD_ARG_(mach_port_name_t, name); | |
785 | PAD_ARG_(uint64_t, guard); | |
786 | PAD_ARG_(boolean_t, strict); | |
787 | }; | |
788 | extern kern_return_t _kernelrpc_mach_port_guard_trap( | |
0a7de745 | 789 | struct _kernelrpc_mach_port_guard_args *args); |
39236c6e A |
790 | |
791 | struct _kernelrpc_mach_port_unguard_args { | |
792 | PAD_ARG_(mach_port_name_t, target); | |
793 | PAD_ARG_(mach_port_name_t, name); | |
794 | PAD_ARG_(uint64_t, guard); | |
795 | }; | |
796 | extern kern_return_t _kernelrpc_mach_port_unguard_trap( | |
0a7de745 | 797 | struct _kernelrpc_mach_port_unguard_args *args); |
39236c6e | 798 | |
39037602 A |
799 | struct mach_generate_activity_id_args { |
800 | PAD_ARG_(mach_port_name_t, target); | |
801 | PAD_ARG_(int, count); | |
802 | PAD_ARG_(user_addr_t, activity_id); | |
803 | }; | |
804 | extern kern_return_t mach_generate_activity_id( | |
0a7de745 | 805 | struct mach_generate_activity_id_args *args); |
39037602 A |
806 | |
807 | /* | |
808 | * Voucher trap interfaces | |
809 | */ | |
810 | ||
811 | struct host_create_mach_voucher_args { | |
812 | PAD_ARG_(mach_port_name_t, host); | |
813 | PAD_ARG_(mach_voucher_attr_raw_recipe_array_t, recipes); | |
814 | PAD_ARG_(int, recipes_size); | |
815 | PAD_ARG_(user_addr_t, voucher); | |
816 | }; | |
817 | extern kern_return_t host_create_mach_voucher_trap( | |
0a7de745 | 818 | struct host_create_mach_voucher_args *args); |
39037602 A |
819 | |
820 | struct mach_voucher_extract_attr_recipe_args { | |
821 | PAD_ARG_(mach_port_name_t, voucher_name); | |
822 | PAD_ARG_(mach_voucher_attr_key_t, key); | |
823 | PAD_ARG_(mach_voucher_attr_raw_recipe_t, recipe); | |
824 | PAD_ARG_(user_addr_t, recipe_size); | |
825 | }; | |
826 | ||
827 | extern kern_return_t mach_voucher_extract_attr_recipe_trap( | |
0a7de745 | 828 | struct mach_voucher_extract_attr_recipe_args *args); |
39037602 | 829 | |
cb323159 A |
830 | struct _kernelrpc_mach_port_type_args { |
831 | PAD_ARG_(mach_port_name_t, target); | |
832 | PAD_ARG_(mach_port_right_t, name); | |
833 | PAD_ARG_(user_addr_t, ptype); | |
834 | }; | |
835 | extern kern_return_t _kernelrpc_mach_port_type_trap( | |
836 | struct _kernelrpc_mach_port_type_args *args); | |
837 | ||
838 | struct _kernelrpc_mach_port_request_notification_args { | |
839 | PAD_ARG_(mach_port_name_t, target); | |
840 | PAD_ARG_(mach_port_name_t, name); | |
841 | PAD_ARG_(mach_msg_id_t, msgid); | |
842 | PAD_ARG_(mach_port_mscount_t, sync); | |
843 | PAD_ARG_(mach_port_name_t, notify); | |
844 | PAD_ARG_(mach_msg_type_name_t, notifyPoly); | |
845 | PAD_ARG_(user_addr_t, previous); | |
846 | }; | |
847 | extern kern_return_t _kernelrpc_mach_port_request_notification_trap( | |
848 | struct _kernelrpc_mach_port_request_notification_args *args); | |
849 | ||
39236c6e | 850 | |
91447636 A |
851 | /* not published to LP64 clients yet */ |
852 | struct iokit_user_client_trap_args { | |
853 | PAD_ARG_(void *, userClientRef); | |
854 | PAD_ARG_(uint32_t, index); | |
855 | PAD_ARG_(void *, p1); | |
856 | PAD_ARG_(void *, p2); | |
857 | PAD_ARG_(void *, p3); | |
858 | PAD_ARG_(void *, p4); | |
859 | PAD_ARG_(void *, p5); | |
0a7de745 A |
860 | PAD_ARG_8 |
861 | PAD_ARG_(void *, p6); | |
91447636 A |
862 | }; |
863 | kern_return_t iokit_user_client_trap( | |
0a7de745 | 864 | struct iokit_user_client_trap_args *args); |
91447636 A |
865 | |
866 | #undef PAD_ | |
867 | #undef PADL_ | |
868 | #undef PADR_ | |
869 | #undef PAD_ARG_ | |
2d21ac55 | 870 | #undef PAD_ARG_8 |
91447636 | 871 | |
0a7de745 | 872 | #endif /* XNU_KERNEL_PRIVATE */ |
91447636 | 873 | |
0a7de745 | 874 | #endif /* KERNEL */ |
91447636 A |
875 | |
876 | __END_DECLS | |
55e303ae | 877 | |
0a7de745 | 878 | #endif /* _MACH_MACH_TRAPS_H_ */ |