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