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