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