]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_traps.h
xnu-2422.1.72.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
6d2010ae 307#if !defined(__LP64__) && !defined(__arm__)
91447636
A
308/* these should go away altogether - so no 64 legacy please */
309
310extern kern_return_t map_fd(
311 int fd,
312 vm_offset_t offset,
313 vm_offset_t *va,
314 boolean_t findspace,
315 vm_size_t size);
316
6d2010ae 317#endif /* !defined(__LP64__) && !defined(__arm__) */
91447636
A
318
319#else /* KERNEL */
320
321#ifdef XNU_KERNEL_PRIVATE
322
6d2010ae
A
323/* Syscall data translations routines
324 *
325 * The kernel may support multiple userspace ABIs, and must use
326 * argument structures with elements large enough for any of them.
327 */
91447636
A
328#define PAD_(t) (sizeof(uint64_t) <= sizeof(t) \
329 ? 0 : sizeof(uint64_t) - sizeof(t))
2d21ac55 330#define PAD_ARG_8
91447636
A
331
332#if BYTE_ORDER == LITTLE_ENDIAN
333#define PADL_(t) 0
334#define PADR_(t) PAD_(t)
335#else
336#define PADL_(t) PAD_(t)
337#define PADR_(t) 0
338#endif
339
340#define PAD_ARG_(arg_type, arg_name) \
341 char arg_name##_l_[PADL_(arg_type)]; arg_type arg_name; char arg_name##_r_[PADR_(arg_type)];
342
6d2010ae
A
343/*
344 * To support 32-bit clients as well as 64-bit clients, argument
345 * structures may need to be munged to repack the arguments. All
346 * active architectures do this inline in the code to dispatch Mach
347 * traps, without calling out to the BSD system call mungers.
348 */
349
350#if 0 /* no active architectures use this */
91447636
A
351void munge_w(const void *, void *);
352void munge_ww(const void *, void *);
353void munge_www(const void *, void *);
354void munge_wwww(const void *, void *);
355void munge_wwwww(const void *, void *);
356void munge_wwwwww(const void *, void *);
357void munge_wwwwwww(const void *, void *);
358void munge_wwwwwwww(const void *, void *);
359void munge_d(const void *, void *);
360void munge_dd(const void *, void *);
361void munge_ddd(const void *, void *);
362void munge_dddd(const void *, void *);
363void munge_ddddd(const void *, void *);
364void munge_dddddd(const void *, void *);
365void munge_ddddddd(const void *, void *);
366void munge_dddddddd(const void *, void *);
367void munge_l(const void *, void *);
b0d623f7
A
368void munge_lw(const void *, void *);
369void munge_lwww(const void *, void *);
91447636
A
370void munge_wl(const void *, void *);
371void munge_wlw(const void *, void *);
372void munge_wwwl(const void *, void *);
373void munge_wwwwl(const void *, void *);
374void munge_wwwwwl(const void *, void *);
6d2010ae 375#endif /* 0 */
91447636
A
376
377struct kern_invalid_args {
b0d623f7 378 int32_t dummy;
91447636
A
379};
380extern kern_return_t kern_invalid(
381 struct kern_invalid_args *args);
382
383struct mach_reply_port_args {
b0d623f7 384 int32_t dummy;
91447636
A
385};
386extern mach_port_name_t mach_reply_port(
387 struct mach_reply_port_args *args);
388
389struct thread_self_trap_args {
b0d623f7 390 int32_t dummy;
91447636
A
391};
392extern mach_port_name_t thread_self_trap(
393 struct thread_self_trap_args *args);
394
395struct task_self_trap_args {
b0d623f7 396 int32_t dummy;
91447636
A
397};
398extern mach_port_name_t task_self_trap(
399 struct task_self_trap_args *args);
400
401struct host_self_trap_args {
b0d623f7 402 int32_t dummy;
91447636
A
403};
404extern mach_port_name_t host_self_trap(
405 struct host_self_trap_args *args);
406
407struct mach_msg_overwrite_trap_args {
316670eb 408 PAD_ARG_(user_addr_t, msg);
91447636
A
409 PAD_ARG_(mach_msg_option_t, option);
410 PAD_ARG_(mach_msg_size_t, send_size);
411 PAD_ARG_(mach_msg_size_t, rcv_size);
412 PAD_ARG_(mach_port_name_t, rcv_name);
413 PAD_ARG_(mach_msg_timeout_t, timeout);
414 PAD_ARG_(mach_port_name_t, notify);
2d21ac55 415 PAD_ARG_8
316670eb 416 PAD_ARG_(user_addr_t, rcv_msg); /* Unused on mach_msg_trap */
91447636
A
417};
418extern mach_msg_return_t mach_msg_trap(
419 struct mach_msg_overwrite_trap_args *args);
420extern mach_msg_return_t mach_msg_overwrite_trap(
421 struct mach_msg_overwrite_trap_args *args);
422
423struct semaphore_signal_trap_args {
424 PAD_ARG_(mach_port_name_t, signal_name);
425};
426extern kern_return_t semaphore_signal_trap(
427 struct semaphore_signal_trap_args *args);
428
429struct semaphore_signal_all_trap_args {
430 PAD_ARG_(mach_port_name_t, signal_name);
431};
432extern kern_return_t semaphore_signal_all_trap(
433 struct semaphore_signal_all_trap_args *args);
434
435struct semaphore_signal_thread_trap_args {
436 PAD_ARG_(mach_port_name_t, signal_name);
437 PAD_ARG_(mach_port_name_t, thread_name);
438};
439extern kern_return_t semaphore_signal_thread_trap(
440 struct semaphore_signal_thread_trap_args *args);
441
442struct semaphore_wait_trap_args {
443 PAD_ARG_(mach_port_name_t, wait_name);
444};
445extern kern_return_t semaphore_wait_trap(
446 struct semaphore_wait_trap_args *args);
447
448struct semaphore_wait_signal_trap_args {
449 PAD_ARG_(mach_port_name_t, wait_name);
450 PAD_ARG_(mach_port_name_t, signal_name);
451};
452extern kern_return_t semaphore_wait_signal_trap(
453 struct semaphore_wait_signal_trap_args *args);
454
455struct semaphore_timedwait_trap_args {
456 PAD_ARG_(mach_port_name_t, wait_name);
457 PAD_ARG_(unsigned int, sec);
458 PAD_ARG_(clock_res_t, nsec);
459};
460extern kern_return_t semaphore_timedwait_trap(
461 struct semaphore_timedwait_trap_args *args);
462
463struct semaphore_timedwait_signal_trap_args {
464 PAD_ARG_(mach_port_name_t, wait_name);
465 PAD_ARG_(mach_port_name_t, signal_name);
466 PAD_ARG_(unsigned int, sec);
467 PAD_ARG_(clock_res_t, nsec);
468};
469extern kern_return_t semaphore_timedwait_signal_trap(
470 struct semaphore_timedwait_signal_trap_args *args);
471
91447636
A
472struct map_fd_args {
473 PAD_ARG_(int, fd);
474 PAD_ARG_(vm_offset_t, offset);
475 PAD_ARG_(vm_offset_t *, va);
476 PAD_ARG_(boolean_t, findspace);
477 PAD_ARG_(vm_size_t, size);
478};
479extern kern_return_t map_fd(
480 struct map_fd_args *args);
481
482struct task_for_pid_args {
483 PAD_ARG_(mach_port_name_t, target_tport);
484 PAD_ARG_(int, pid);
485 PAD_ARG_(user_addr_t, t);
486};
487extern kern_return_t task_for_pid(
488 struct task_for_pid_args *args);
489
0c530ab8
A
490struct task_name_for_pid_args {
491 PAD_ARG_(mach_port_name_t, target_tport);
492 PAD_ARG_(int, pid);
493 PAD_ARG_(user_addr_t, t);
494};
495extern kern_return_t task_name_for_pid(
496 struct task_name_for_pid_args *args);
497
91447636
A
498struct pid_for_task_args {
499 PAD_ARG_(mach_port_name_t, t);
500 PAD_ARG_(user_addr_t, pid);
501};
502extern kern_return_t pid_for_task(
503 struct pid_for_task_args *args);
504
91447636 505struct macx_swapon_args {
b0d623f7 506 PAD_ARG_(uint64_t, filename);
91447636
A
507 PAD_ARG_(int, flags);
508 PAD_ARG_(int, size);
509 PAD_ARG_(int, priority);
510};
511extern kern_return_t macx_swapon(
512 struct macx_swapon_args *args);
513
514struct macx_swapoff_args {
b0d623f7 515 PAD_ARG_(uint64_t, filename);
91447636
A
516 PAD_ARG_(int, flags);
517};
518extern kern_return_t macx_swapoff(
519 struct macx_swapoff_args *args);
520
521struct macx_triggers_args {
522 PAD_ARG_(int, hi_water);
523 PAD_ARG_(int, low_water);
524 PAD_ARG_(int, flags);
525 PAD_ARG_(mach_port_t, alert_port);
526};
527extern kern_return_t macx_triggers(
528 struct macx_triggers_args *args);
529
530struct macx_backing_store_suspend_args {
531 PAD_ARG_(boolean_t, suspend);
532};
533extern kern_return_t macx_backing_store_suspend(
534 struct macx_backing_store_suspend_args *args);
535
536struct macx_backing_store_recovery_args {
537 PAD_ARG_(int, pid);
538};
539extern kern_return_t macx_backing_store_recovery(
540 struct macx_backing_store_recovery_args *args);
541
542struct swtch_pri_args {
543 PAD_ARG_(int, pri);
544};
545extern boolean_t swtch_pri(
546 struct swtch_pri_args *args);
547
b0d623f7
A
548struct pfz_exit_args {
549 int32_t dummy;
550};
551extern kern_return_t pfz_exit(
552 struct pfz_exit_args *args);
553
91447636 554struct swtch_args {
b0d623f7 555 int32_t dummy;
91447636
A
556};
557extern boolean_t swtch(
558 struct swtch_args *args);
559
560struct clock_sleep_trap_args{
561 PAD_ARG_(mach_port_name_t, clock_name);
562 PAD_ARG_(sleep_type_t, sleep_type);
563 PAD_ARG_(int, sleep_sec);
564 PAD_ARG_(int, sleep_nsec);
316670eb 565 PAD_ARG_(user_addr_t, wakeup_time);
91447636
A
566};
567extern kern_return_t clock_sleep_trap(
568 struct clock_sleep_trap_args *args);
569
570struct thread_switch_args {
571 PAD_ARG_(mach_port_name_t, thread_name);
572 PAD_ARG_(int, option);
573 PAD_ARG_(mach_msg_timeout_t, option_time);
574};
575extern kern_return_t thread_switch(
576 struct thread_switch_args *args);
577
578struct mach_timebase_info_trap_args {
316670eb 579 PAD_ARG_(user_addr_t, info);
91447636
A
580};
581extern kern_return_t mach_timebase_info_trap(
582 struct mach_timebase_info_trap_args *args);
583
584struct mach_wait_until_trap_args {
585 PAD_ARG_(uint64_t, deadline);
586};
587extern kern_return_t mach_wait_until_trap(
588 struct mach_wait_until_trap_args *args);
589
590struct mk_timer_create_trap_args {
b0d623f7 591 int32_t dummy;
91447636
A
592};
593extern mach_port_name_t mk_timer_create_trap(
594 struct mk_timer_create_trap_args *args);
595
596struct mk_timer_destroy_trap_args {
597 PAD_ARG_(mach_port_name_t, name);
598};
599extern kern_return_t mk_timer_destroy_trap(
600 struct mk_timer_destroy_trap_args *args);
601
602struct mk_timer_arm_trap_args {
603 PAD_ARG_(mach_port_name_t, name);
604 PAD_ARG_(uint64_t, expire_time);
605};
606extern kern_return_t mk_timer_arm_trap(
607 struct mk_timer_arm_trap_args *args);
608
609struct mk_timer_cancel_trap_args {
610 PAD_ARG_(mach_port_name_t, name);
316670eb 611 PAD_ARG_(user_addr_t, result_time);
91447636
A
612};
613extern kern_return_t mk_timer_cancel_trap(
614 struct mk_timer_cancel_trap_args *args);
615
316670eb
A
616struct _kernelrpc_mach_vm_allocate_trap_args {
617 PAD_ARG_(mach_port_name_t, target); /* 1 word */
618 PAD_ARG_(user_addr_t, addr); /* 1 word */
619 PAD_ARG_(mach_vm_size_t, size); /* 2 words */
620 PAD_ARG_(int, flags); /* 1 word */
621}; /* Total: 5 */
622
623extern kern_return_t _kernelrpc_mach_vm_allocate_trap(
624 struct _kernelrpc_mach_vm_allocate_trap_args *args);
625
626struct _kernelrpc_mach_vm_deallocate_args {
627 PAD_ARG_(mach_port_name_t, target); /* 1 word */
628 PAD_ARG_(mach_vm_address_t, address); /* 2 words */
629 PAD_ARG_(mach_vm_size_t, size); /* 2 words */
630}; /* Total: 5 */
631extern kern_return_t _kernelrpc_mach_vm_deallocate_trap(
632 struct _kernelrpc_mach_vm_deallocate_args *args);
633
634struct _kernelrpc_mach_vm_protect_args {
635 PAD_ARG_(mach_port_name_t, target); /* 1 word */
636 PAD_ARG_(mach_vm_address_t, address); /* 2 words */
637 PAD_ARG_(mach_vm_size_t, size); /* 2 words */
638 PAD_ARG_(boolean_t, set_maximum); /* 1 word */
639 PAD_ARG_(vm_prot_t, new_protection); /* 1 word */
640}; /* Total: 7 */
641extern kern_return_t _kernelrpc_mach_vm_protect_trap(
642 struct _kernelrpc_mach_vm_protect_args *args);
643
39236c6e
A
644struct _kernelrpc_mach_vm_map_trap_args {
645 PAD_ARG_(mach_port_name_t, target);
646 PAD_ARG_(user_addr_t, addr);
647 PAD_ARG_(mach_vm_size_t, size);
648 PAD_ARG_(mach_vm_offset_t, mask);
649 PAD_ARG_(int, flags);
650 PAD_ARG_8
651 PAD_ARG_(vm_prot_t, cur_protection);
652};
653extern kern_return_t _kernelrpc_mach_vm_map_trap(
654 struct _kernelrpc_mach_vm_map_trap_args *args);
655
316670eb
A
656struct _kernelrpc_mach_port_allocate_args {
657 PAD_ARG_(mach_port_name_t, target);
658 PAD_ARG_(mach_port_right_t, right);
659 PAD_ARG_(user_addr_t, name);
660};
661extern kern_return_t _kernelrpc_mach_port_allocate_trap(
662 struct _kernelrpc_mach_port_allocate_args *args);
663
664
665struct _kernelrpc_mach_port_destroy_args {
666 PAD_ARG_(mach_port_name_t, target);
667 PAD_ARG_(mach_port_name_t, name);
668};
669extern kern_return_t _kernelrpc_mach_port_destroy_trap(
670 struct _kernelrpc_mach_port_destroy_args *args);
671
672struct _kernelrpc_mach_port_deallocate_args {
673 PAD_ARG_(mach_port_name_t, target);
674 PAD_ARG_(mach_port_name_t, name);
675};
676extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
677 struct _kernelrpc_mach_port_deallocate_args *args);
678
679struct _kernelrpc_mach_port_mod_refs_args {
680 PAD_ARG_(mach_port_name_t, target);
681 PAD_ARG_(mach_port_name_t, name);
682 PAD_ARG_(mach_port_right_t, right);
683 PAD_ARG_(mach_port_delta_t, delta);
684};
685extern kern_return_t _kernelrpc_mach_port_mod_refs_trap(
686 struct _kernelrpc_mach_port_mod_refs_args *args);
687
688struct _kernelrpc_mach_port_move_member_args {
689 PAD_ARG_(mach_port_name_t, target);
690 PAD_ARG_(mach_port_name_t, member);
691 PAD_ARG_(mach_port_name_t, after);
692};
693extern kern_return_t _kernelrpc_mach_port_move_member_trap(
694 struct _kernelrpc_mach_port_move_member_args *args);
695
696struct _kernelrpc_mach_port_insert_right_args {
697 PAD_ARG_(mach_port_name_t, target);
698 PAD_ARG_(mach_port_name_t, name);
699 PAD_ARG_(mach_port_name_t, poly);
700 PAD_ARG_(mach_msg_type_name_t, polyPoly);
701};
702extern kern_return_t _kernelrpc_mach_port_insert_right_trap(
703 struct _kernelrpc_mach_port_insert_right_args *args);
704
705struct _kernelrpc_mach_port_insert_member_args {
706 PAD_ARG_(mach_port_name_t, target);
707 PAD_ARG_(mach_port_name_t, name);
708 PAD_ARG_(mach_port_name_t, pset);
709};
710extern kern_return_t _kernelrpc_mach_port_insert_member_trap(
711 struct _kernelrpc_mach_port_insert_member_args *args);
712
713struct _kernelrpc_mach_port_extract_member_args {
714 PAD_ARG_(mach_port_name_t, target);
715 PAD_ARG_(mach_port_name_t, name);
716 PAD_ARG_(mach_port_name_t, pset);
717};
718extern kern_return_t _kernelrpc_mach_port_extract_member_trap(
719 struct _kernelrpc_mach_port_extract_member_args *args);
720
39236c6e
A
721struct _kernelrpc_mach_port_construct_args {
722 PAD_ARG_(mach_port_name_t, target);
723 PAD_ARG_(user_addr_t, options);
724 PAD_ARG_(uint64_t, context);
725 PAD_ARG_(user_addr_t, name);
726};
727extern kern_return_t _kernelrpc_mach_port_construct_trap(
728 struct _kernelrpc_mach_port_construct_args *args);
729
730struct _kernelrpc_mach_port_destruct_args {
731 PAD_ARG_(mach_port_name_t, target);
732 PAD_ARG_(mach_port_name_t, name);
733 PAD_ARG_(mach_port_delta_t, srdelta);
734 PAD_ARG_(uint64_t, guard);
735};
736extern kern_return_t _kernelrpc_mach_port_destruct_trap(
737 struct _kernelrpc_mach_port_destruct_args *args);
738
739struct _kernelrpc_mach_port_guard_args {
740 PAD_ARG_(mach_port_name_t, target);
741 PAD_ARG_(mach_port_name_t, name);
742 PAD_ARG_(uint64_t, guard);
743 PAD_ARG_(boolean_t, strict);
744};
745extern kern_return_t _kernelrpc_mach_port_guard_trap(
746 struct _kernelrpc_mach_port_guard_args *args);
747
748struct _kernelrpc_mach_port_unguard_args {
749 PAD_ARG_(mach_port_name_t, target);
750 PAD_ARG_(mach_port_name_t, name);
751 PAD_ARG_(uint64_t, guard);
752};
753extern kern_return_t _kernelrpc_mach_port_unguard_trap(
754 struct _kernelrpc_mach_port_unguard_args *args);
755
756
91447636
A
757/* not published to LP64 clients yet */
758struct iokit_user_client_trap_args {
759 PAD_ARG_(void *, userClientRef);
760 PAD_ARG_(uint32_t, index);
761 PAD_ARG_(void *, p1);
762 PAD_ARG_(void *, p2);
763 PAD_ARG_(void *, p3);
764 PAD_ARG_(void *, p4);
765 PAD_ARG_(void *, p5);
2d21ac55 766 PAD_ARG_8
91447636
A
767 PAD_ARG_(void *, p6);
768};
769kern_return_t iokit_user_client_trap(
770 struct iokit_user_client_trap_args *args);
771
772#undef PAD_
773#undef PADL_
774#undef PADR_
775#undef PAD_ARG_
2d21ac55 776#undef PAD_ARG_8
91447636
A
777
778#endif /* XNU_KERNEL_PRIVATE */
779
780#endif /* KERNEL */
781
782__END_DECLS
55e303ae 783
1c79356b 784#endif /* _MACH_MACH_TRAPS_H_ */