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