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