]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_traps.h
xnu-2782.40.9.tar.gz
[apple/xnu.git] / osfmk / mach / mach_traps.h
CommitLineData
1c79356b 1/*
2d21ac55 2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
1c79356b 3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
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 *
91447636
A
61 * These are the definitions as seen from user-space.
62 * The kernel definitions are in <mach/syscall_sw.h>.
1c79356b
A
63 * Kernel RPC functions are defined in <mach/mach_interface.h>.
64 */
65
66#ifndef _MACH_MACH_TRAPS_H_
67#define _MACH_MACH_TRAPS_H_
68
91447636
A
69#include <stdint.h>
70
71#include <mach/std_types.h>
72#include <mach/mach_types.h>
1c79356b
A
73#include <mach/kern_return.h>
74#include <mach/port.h>
75#include <mach/vm_types.h>
76#include <mach/clock_types.h>
1c79356b 77
91447636
A
78#include <machine/endian.h>
79
80#include <sys/cdefs.h>
81
82__BEGIN_DECLS
83
84#ifndef KERNEL
85
86#ifdef PRIVATE
1c79356b 87
91447636 88extern mach_port_name_t mach_reply_port(void);
1c79356b 89
91447636 90extern mach_port_name_t thread_self_trap(void);
1c79356b 91
91447636 92extern mach_port_name_t host_self_trap(void);
1c79356b 93
91447636
A
94extern 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
103extern 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
114extern kern_return_t semaphore_signal_trap(
1c79356b
A
115 mach_port_name_t signal_name);
116
91447636 117extern kern_return_t semaphore_signal_all_trap(
1c79356b
A
118 mach_port_name_t signal_name);
119
91447636 120extern kern_return_t semaphore_signal_thread_trap(
1c79356b
A
121 mach_port_name_t signal_name,
122 mach_port_name_t thread_name);
123
91447636 124extern kern_return_t semaphore_wait_trap(
1c79356b
A
125 mach_port_name_t wait_name);
126
91447636 127extern kern_return_t semaphore_wait_signal_trap(
1c79356b 128 mach_port_name_t wait_name,
91447636 129 mach_port_name_t signal_name);
1c79356b 130
91447636 131extern kern_return_t semaphore_timedwait_trap(
1c79356b 132 mach_port_name_t wait_name,
91447636
A
133 unsigned int sec,
134 clock_res_t nsec);
1c79356b 135
91447636 136extern kern_return_t semaphore_timedwait_signal_trap(
1c79356b
A
137 mach_port_name_t wait_name,
138 mach_port_name_t signal_name,
139 unsigned int sec,
140 clock_res_t nsec);
141
316670eb
A
142#endif /* PRIVATE */
143
b0d623f7
A
144extern 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);
91447636 150
316670eb
A
151extern 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
157extern 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
163extern 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
39236c6e
A
171extern 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
316670eb
A
180extern 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
187extern kern_return_t _kernelrpc_mach_port_destroy_trap(
188 mach_port_name_t target,
189 mach_port_name_t name
190);
191
192extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
193 mach_port_name_t target,
194 mach_port_name_t name
195);
196
197extern 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
204extern 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
210extern 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
217extern 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
223extern 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);
91447636 228
39236c6e
A
229extern 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
236extern 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
243extern 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
250extern 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
91447636 256extern kern_return_t macx_swapon(
b0d623f7 257 uint64_t filename,
91447636
A
258 int flags,
259 int size,
260 int priority);
261
262extern kern_return_t macx_swapoff(
b0d623f7 263 uint64_t filename,
91447636
A
264 int flags);
265
266extern kern_return_t macx_triggers(
267 int hi_water,
268 int low_water,
269 int flags,
270 mach_port_t alert_port);
271
272extern kern_return_t macx_backing_store_suspend(
273 boolean_t suspend);
274
275extern kern_return_t macx_backing_store_recovery(
276 int pid);
277
91447636
A
278extern boolean_t swtch_pri(int pri);
279
280extern boolean_t swtch(void);
281
282extern kern_return_t thread_switch(
283 mach_port_name_t thread_name,
284 int option,
285 mach_msg_timeout_t option_time);
286
287extern mach_port_name_t task_self_trap(void);
288
289/*
290 * Obsolete interfaces.
291 */
292
293extern kern_return_t task_for_pid(
294 mach_port_name_t target_tport,
295 int pid,
296 mach_port_name_t *t);
297
0c530ab8
A
298extern kern_return_t task_name_for_pid(
299 mach_port_name_t target_tport,
300 int pid,
301 mach_port_name_t *tn);
302
91447636
A
303extern kern_return_t pid_for_task(
304 mach_port_name_t t,
305 int *x);
306
91447636
A
307#else /* KERNEL */
308
309#ifdef XNU_KERNEL_PRIVATE
310
6d2010ae
A
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 */
fe8ab488 316#if CONFIG_REQUIRES_U32_MUNGING
91447636
A
317#define PAD_(t) (sizeof(uint64_t) <= sizeof(t) \
318 ? 0 : sizeof(uint64_t) - sizeof(t))
2d21ac55 319#define PAD_ARG_8
fe8ab488
A
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
91447636
A
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
6d2010ae
A
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
91447636 344struct kern_invalid_args {
b0d623f7 345 int32_t dummy;
91447636
A
346};
347extern kern_return_t kern_invalid(
348 struct kern_invalid_args *args);
349
350struct mach_reply_port_args {
b0d623f7 351 int32_t dummy;
91447636
A
352};
353extern mach_port_name_t mach_reply_port(
354 struct mach_reply_port_args *args);
355
356struct thread_self_trap_args {
b0d623f7 357 int32_t dummy;
91447636
A
358};
359extern mach_port_name_t thread_self_trap(
360 struct thread_self_trap_args *args);
361
362struct task_self_trap_args {
b0d623f7 363 int32_t dummy;
91447636
A
364};
365extern mach_port_name_t task_self_trap(
366 struct task_self_trap_args *args);
367
368struct host_self_trap_args {
b0d623f7 369 int32_t dummy;
91447636
A
370};
371extern mach_port_name_t host_self_trap(
372 struct host_self_trap_args *args);
373
374struct mach_msg_overwrite_trap_args {
316670eb 375 PAD_ARG_(user_addr_t, msg);
91447636
A
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);
2d21ac55 382 PAD_ARG_8
316670eb 383 PAD_ARG_(user_addr_t, rcv_msg); /* Unused on mach_msg_trap */
91447636
A
384};
385extern mach_msg_return_t mach_msg_trap(
386 struct mach_msg_overwrite_trap_args *args);
387extern mach_msg_return_t mach_msg_overwrite_trap(
388 struct mach_msg_overwrite_trap_args *args);
389
390struct semaphore_signal_trap_args {
391 PAD_ARG_(mach_port_name_t, signal_name);
392};
393extern kern_return_t semaphore_signal_trap(
394 struct semaphore_signal_trap_args *args);
395
396struct semaphore_signal_all_trap_args {
397 PAD_ARG_(mach_port_name_t, signal_name);
398};
399extern kern_return_t semaphore_signal_all_trap(
400 struct semaphore_signal_all_trap_args *args);
401
402struct semaphore_signal_thread_trap_args {
403 PAD_ARG_(mach_port_name_t, signal_name);
404 PAD_ARG_(mach_port_name_t, thread_name);
405};
406extern kern_return_t semaphore_signal_thread_trap(
407 struct semaphore_signal_thread_trap_args *args);
408
409struct semaphore_wait_trap_args {
410 PAD_ARG_(mach_port_name_t, wait_name);
411};
412extern kern_return_t semaphore_wait_trap(
413 struct semaphore_wait_trap_args *args);
414
415struct semaphore_wait_signal_trap_args {
416 PAD_ARG_(mach_port_name_t, wait_name);
417 PAD_ARG_(mach_port_name_t, signal_name);
418};
419extern kern_return_t semaphore_wait_signal_trap(
420 struct semaphore_wait_signal_trap_args *args);
421
422struct 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};
427extern kern_return_t semaphore_timedwait_trap(
428 struct semaphore_timedwait_trap_args *args);
429
430struct 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};
436extern kern_return_t semaphore_timedwait_signal_trap(
437 struct semaphore_timedwait_signal_trap_args *args);
438
91447636
A
439struct 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};
444extern kern_return_t task_for_pid(
445 struct task_for_pid_args *args);
446
0c530ab8
A
447struct 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};
452extern kern_return_t task_name_for_pid(
453 struct task_name_for_pid_args *args);
454
91447636
A
455struct pid_for_task_args {
456 PAD_ARG_(mach_port_name_t, t);
457 PAD_ARG_(user_addr_t, pid);
458};
459extern kern_return_t pid_for_task(
460 struct pid_for_task_args *args);
461
91447636 462struct macx_swapon_args {
b0d623f7 463 PAD_ARG_(uint64_t, filename);
91447636
A
464 PAD_ARG_(int, flags);
465 PAD_ARG_(int, size);
466 PAD_ARG_(int, priority);
467};
468extern kern_return_t macx_swapon(
469 struct macx_swapon_args *args);
470
471struct macx_swapoff_args {
b0d623f7 472 PAD_ARG_(uint64_t, filename);
91447636
A
473 PAD_ARG_(int, flags);
474};
475extern kern_return_t macx_swapoff(
476 struct macx_swapoff_args *args);
477
478struct 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};
484extern kern_return_t macx_triggers(
485 struct macx_triggers_args *args);
486
487struct macx_backing_store_suspend_args {
488 PAD_ARG_(boolean_t, suspend);
489};
490extern kern_return_t macx_backing_store_suspend(
491 struct macx_backing_store_suspend_args *args);
492
493struct macx_backing_store_recovery_args {
494 PAD_ARG_(int, pid);
495};
496extern kern_return_t macx_backing_store_recovery(
497 struct macx_backing_store_recovery_args *args);
498
499struct swtch_pri_args {
500 PAD_ARG_(int, pri);
501};
502extern boolean_t swtch_pri(
503 struct swtch_pri_args *args);
504
b0d623f7
A
505struct pfz_exit_args {
506 int32_t dummy;
507};
508extern kern_return_t pfz_exit(
509 struct pfz_exit_args *args);
510
91447636 511struct swtch_args {
b0d623f7 512 int32_t dummy;
91447636
A
513};
514extern boolean_t swtch(
515 struct swtch_args *args);
516
517struct 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);
316670eb 522 PAD_ARG_(user_addr_t, wakeup_time);
91447636
A
523};
524extern kern_return_t clock_sleep_trap(
525 struct clock_sleep_trap_args *args);
526
527struct 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};
532extern kern_return_t thread_switch(
533 struct thread_switch_args *args);
534
535struct mach_timebase_info_trap_args {
316670eb 536 PAD_ARG_(user_addr_t, info);
91447636
A
537};
538extern kern_return_t mach_timebase_info_trap(
539 struct mach_timebase_info_trap_args *args);
540
541struct mach_wait_until_trap_args {
542 PAD_ARG_(uint64_t, deadline);
543};
544extern kern_return_t mach_wait_until_trap(
545 struct mach_wait_until_trap_args *args);
546
547struct mk_timer_create_trap_args {
b0d623f7 548 int32_t dummy;
91447636
A
549};
550extern mach_port_name_t mk_timer_create_trap(
551 struct mk_timer_create_trap_args *args);
552
553struct mk_timer_destroy_trap_args {
554 PAD_ARG_(mach_port_name_t, name);
555};
556extern kern_return_t mk_timer_destroy_trap(
557 struct mk_timer_destroy_trap_args *args);
558
559struct mk_timer_arm_trap_args {
560 PAD_ARG_(mach_port_name_t, name);
561 PAD_ARG_(uint64_t, expire_time);
562};
563extern kern_return_t mk_timer_arm_trap(
564 struct mk_timer_arm_trap_args *args);
565
566struct mk_timer_cancel_trap_args {
567 PAD_ARG_(mach_port_name_t, name);
316670eb 568 PAD_ARG_(user_addr_t, result_time);
91447636
A
569};
570extern kern_return_t mk_timer_cancel_trap(
571 struct mk_timer_cancel_trap_args *args);
572
316670eb
A
573struct _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
580extern kern_return_t _kernelrpc_mach_vm_allocate_trap(
581 struct _kernelrpc_mach_vm_allocate_trap_args *args);
582
583struct _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 */
588extern kern_return_t _kernelrpc_mach_vm_deallocate_trap(
589 struct _kernelrpc_mach_vm_deallocate_args *args);
590
591struct _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 */
598extern kern_return_t _kernelrpc_mach_vm_protect_trap(
599 struct _kernelrpc_mach_vm_protect_args *args);
600
39236c6e
A
601struct _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};
610extern kern_return_t _kernelrpc_mach_vm_map_trap(
611 struct _kernelrpc_mach_vm_map_trap_args *args);
612
316670eb
A
613struct _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};
618extern kern_return_t _kernelrpc_mach_port_allocate_trap(
619 struct _kernelrpc_mach_port_allocate_args *args);
620
621
622struct _kernelrpc_mach_port_destroy_args {
623 PAD_ARG_(mach_port_name_t, target);
624 PAD_ARG_(mach_port_name_t, name);
625};
626extern kern_return_t _kernelrpc_mach_port_destroy_trap(
627 struct _kernelrpc_mach_port_destroy_args *args);
628
629struct _kernelrpc_mach_port_deallocate_args {
630 PAD_ARG_(mach_port_name_t, target);
631 PAD_ARG_(mach_port_name_t, name);
632};
633extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
634 struct _kernelrpc_mach_port_deallocate_args *args);
635
636struct _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};
642extern kern_return_t _kernelrpc_mach_port_mod_refs_trap(
643 struct _kernelrpc_mach_port_mod_refs_args *args);
644
645struct _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};
650extern kern_return_t _kernelrpc_mach_port_move_member_trap(
651 struct _kernelrpc_mach_port_move_member_args *args);
652
653struct _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};
659extern kern_return_t _kernelrpc_mach_port_insert_right_trap(
660 struct _kernelrpc_mach_port_insert_right_args *args);
661
662struct _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};
667extern kern_return_t _kernelrpc_mach_port_insert_member_trap(
668 struct _kernelrpc_mach_port_insert_member_args *args);
669
670struct _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};
675extern kern_return_t _kernelrpc_mach_port_extract_member_trap(
676 struct _kernelrpc_mach_port_extract_member_args *args);
677
39236c6e
A
678struct _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};
684extern kern_return_t _kernelrpc_mach_port_construct_trap(
685 struct _kernelrpc_mach_port_construct_args *args);
686
687struct _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};
693extern kern_return_t _kernelrpc_mach_port_destruct_trap(
694 struct _kernelrpc_mach_port_destruct_args *args);
695
696struct _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};
702extern kern_return_t _kernelrpc_mach_port_guard_trap(
703 struct _kernelrpc_mach_port_guard_args *args);
704
705struct _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};
710extern kern_return_t _kernelrpc_mach_port_unguard_trap(
711 struct _kernelrpc_mach_port_unguard_args *args);
712
713
91447636
A
714/* not published to LP64 clients yet */
715struct 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);
2d21ac55 723 PAD_ARG_8
91447636
A
724 PAD_ARG_(void *, p6);
725};
726kern_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_
2d21ac55 733#undef PAD_ARG_8
91447636
A
734
735#endif /* XNU_KERNEL_PRIVATE */
736
737#endif /* KERNEL */
738
739__END_DECLS
55e303ae 740
1c79356b 741#endif /* _MACH_MACH_TRAPS_H_ */