]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/syscall_sw.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / mach / syscall_sw.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2004 Apple Computer, 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
91447636
A
57#ifdef PRIVATE
58
1c79356b
A
59#ifndef _MACH_SYSCALL_SW_H_
60#define _MACH_SYSCALL_SW_H_
61
62/*
63 * The machine-dependent "syscall_sw.h" file should
64 * define a macro for
65 * kernel_trap(trap_name, trap_number, arg_count)
66 * which will expand into assembly code for the
67 * trap.
68 *
69 * N.B.: When adding calls, do not put spaces in the macros.
70 */
71
72#include <mach/machine/syscall_sw.h>
73
74/*
75 * These trap numbers should be taken from the
76 * table in <kern/syscall_sw.c>.
77 */
78
316670eb
A
79/*
80 * i386 and x86_64 just load of the stack or use
81 * registers in order; no munging is required,
82 * and number of args is ignored. ARM loads args
83 * into registers beyond r3, unlike the normal
84 * procedure call standard; we pad for 64-bit args.
85 */
86kernel_trap(_kernelrpc_mach_vm_allocate_trap,-10,5) /* 4 args, +1 for mach_vm_size_t */
39037602 87kernel_trap(_kernelrpc_mach_vm_purgable_control_trap,-11,5) /* 4 args, +1 for mach_vm_offset_t */
316670eb 88kernel_trap(_kernelrpc_mach_vm_deallocate_trap,-12,5) /* 3 args, +2 for mach_vm_size_t and mach_vm_address_t */
c3c9b80d 89kernel_trap(task_dyld_process_info_notify_get,-13,4) /* 2 args, +2 for mach_vm_address_t */
316670eb 90kernel_trap(_kernelrpc_mach_vm_protect_trap,-14,7) /* 5 args, +2 for mach_vm_address_t and mach_vm_size_t */
39236c6e 91kernel_trap(_kernelrpc_mach_vm_map_trap,-15,9)
316670eb 92kernel_trap(_kernelrpc_mach_port_allocate_trap,-16,3)
f427ee49 93/* mach_port_destroy */
316670eb
A
94kernel_trap(_kernelrpc_mach_port_deallocate_trap,-18,2)
95kernel_trap(_kernelrpc_mach_port_mod_refs_trap,-19,4)
96kernel_trap(_kernelrpc_mach_port_move_member_trap,-20,3)
97kernel_trap(_kernelrpc_mach_port_insert_right_trap,-21,4)
98kernel_trap(_kernelrpc_mach_port_insert_member_trap,-22,3)
99kernel_trap(_kernelrpc_mach_port_extract_member_trap,-23,3)
39236c6e
A
100kernel_trap(_kernelrpc_mach_port_construct_trap,-24,5)
101kernel_trap(_kernelrpc_mach_port_destruct_trap,-25,5)
316670eb 102
1c79356b
A
103kernel_trap(mach_reply_port,-26,0)
104kernel_trap(thread_self_trap,-27,0)
105kernel_trap(task_self_trap,-28,0)
106kernel_trap(host_self_trap,-29,0)
91447636 107
9bccf70c 108kernel_trap(mach_msg_trap,-31,7)
1c79356b
A
109kernel_trap(mach_msg_overwrite_trap,-32,9)
110kernel_trap(semaphore_signal_trap, -33, 1)
111kernel_trap(semaphore_signal_all_trap, -34, 1)
112kernel_trap(semaphore_signal_thread_trap, -35, 2)
113kernel_trap(semaphore_wait_trap,-36,1)
114kernel_trap(semaphore_wait_signal_trap,-37,2)
115kernel_trap(semaphore_timedwait_trap,-38,3)
116kernel_trap(semaphore_timedwait_signal_trap,-39,4)
117
d9a64523 118kernel_trap(_kernelrpc_mach_port_get_attributes_trap,-40,5)
39236c6e
A
119kernel_trap(_kernelrpc_mach_port_guard_trap,-41,5)
120kernel_trap(_kernelrpc_mach_port_unguard_trap,-42,4)
39037602 121kernel_trap(mach_generate_activity_id, -43, 3)
91447636 122
0c530ab8 123kernel_trap(task_name_for_pid,-44,3)
1c79356b
A
124kernel_trap(task_for_pid,-45,3)
125kernel_trap(pid_for_task,-46,2)
91447636 126
b0d623f7 127#if defined(__LP64__)
1c79356b
A
128kernel_trap(macx_swapon,-48, 4)
129kernel_trap(macx_swapoff,-49, 2)
b0d623f7
A
130#else /* __LP64__ */
131kernel_trap(macx_swapon,-48, 5)
132kernel_trap(macx_swapoff,-49, 3)
133#endif /* __LP64__ */
5ba3f43e 134kernel_trap(thread_get_special_reply_port,-50,0)
1c79356b 135kernel_trap(macx_triggers,-51, 4)
55e303ae
A
136kernel_trap(macx_backing_store_suspend,-52, 1)
137kernel_trap(macx_backing_store_recovery,-53, 1)
1c79356b 138
91447636
A
139/* These are currently used by pthreads even on LP64 */
140/* But as soon as that is fixed - they will go away there */
1c79356b
A
141kernel_trap(swtch_pri,-59,1)
142kernel_trap(swtch,-60,0)
91447636 143
1c79356b
A
144kernel_trap(syscall_thread_switch,-61,3)
145kernel_trap(clock_sleep_trap,-62,5)
146
39037602
A
147/* voucher traps */
148kernel_trap(host_create_mach_voucher_trap,-70,4)
149/* mach_voucher_extract_attr_content */
150kernel_trap(mach_voucher_extract_attr_recipe_trap,-72,4)
151/* mach_voucher_extract_all_attr_recipes */
152/* mach_voucher_attr_command */
153/* mach_voucher_debug_info */
154
cb323159
A
155/* more mach_port traps */
156kernel_trap(_kernelrpc_mach_port_type_trap,-76,3)
157kernel_trap(_kernelrpc_mach_port_request_notification_trap,-77,7)
158
39037602 159kernel_trap(mach_timebase_info_trap,-89,1)
91447636
A
160
161#if defined(__LP64__)
162/* unit64_t arguments passed in one register in LP64 */
163kernel_trap(mach_wait_until,-90,1)
164#else /* __LP64__ */
1c79356b 165kernel_trap(mach_wait_until,-90,2)
91447636
A
166#endif /* __LP64__ */
167
1c79356b
A
168kernel_trap(mk_timer_create,-91,0)
169kernel_trap(mk_timer_destroy,-92,1)
91447636
A
170
171#if defined(__LP64__)
172/* unit64_t arguments passed in one register in LP64 */
173kernel_trap(mk_timer_arm,-93,2)
174#else /* __LP64__ */
1c79356b 175kernel_trap(mk_timer_arm,-93,3)
91447636
A
176#endif /* __LP64__ */
177
1c79356b 178kernel_trap(mk_timer_cancel,-94,2)
813fb2f6
A
179#if defined(__LP64__)
180kernel_trap(mk_timer_arm_leeway,-95,4)
181#else
182kernel_trap(mk_timer_arm_leeway,-95,7)
183#endif
cb323159
A
184kernel_trap(debug_control_port_for_pid,-96,3)
185
2d21ac55
A
186/*
187 * N.B: Trap #-100 is in use by IOTrap.s in the IOKit Framework
188 * (iokit_user_client_trap)
189 */
1c79356b 190#endif /* _MACH_SYSCALL_SW_H_ */
91447636
A
191
192#endif /* PRIVATE */