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