2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
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.
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.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
59 #ifndef _MACH_SYSCALL_SW_H_
60 #define _MACH_SYSCALL_SW_H_
63 * The machine-dependent "syscall_sw.h" file should
65 * kernel_trap(trap_name, trap_number, arg_count)
66 * which will expand into assembly code for the
69 * N.B.: When adding calls, do not put spaces in the macros.
72 #include <mach/machine/syscall_sw.h>
75 * These trap numbers should be taken from the
76 * table in <kern/syscall_sw.c>.
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.
86 kernel_trap(_kernelrpc_mach_vm_allocate_trap
,-10,5) /* 4 args, +1 for mach_vm_size_t */
87 kernel_trap(_kernelrpc_mach_vm_deallocate_trap
,-12,5) /* 3 args, +2 for mach_vm_size_t and mach_vm_address_t */
88 kernel_trap(_kernelrpc_mach_vm_protect_trap
,-14,7) /* 5 args, +2 for mach_vm_address_t and mach_vm_size_t */
89 kernel_trap(_kernelrpc_mach_vm_map_trap
,-15,9)
90 kernel_trap(_kernelrpc_mach_port_allocate_trap
,-16,3)
91 kernel_trap(_kernelrpc_mach_port_destroy_trap
,-17,2)
92 kernel_trap(_kernelrpc_mach_port_deallocate_trap
,-18,2)
93 kernel_trap(_kernelrpc_mach_port_mod_refs_trap
,-19,4)
94 kernel_trap(_kernelrpc_mach_port_move_member_trap
,-20,3)
95 kernel_trap(_kernelrpc_mach_port_insert_right_trap
,-21,4)
96 kernel_trap(_kernelrpc_mach_port_insert_member_trap
,-22,3)
97 kernel_trap(_kernelrpc_mach_port_extract_member_trap
,-23,3)
98 kernel_trap(_kernelrpc_mach_port_construct_trap
,-24,5)
99 kernel_trap(_kernelrpc_mach_port_destruct_trap
,-25,5)
101 kernel_trap(mach_reply_port
,-26,0)
102 kernel_trap(thread_self_trap
,-27,0)
103 kernel_trap(task_self_trap
,-28,0)
104 kernel_trap(host_self_trap
,-29,0)
106 kernel_trap(mach_msg_trap
,-31,7)
107 kernel_trap(mach_msg_overwrite_trap
,-32,9)
108 kernel_trap(semaphore_signal_trap
, -33, 1)
109 kernel_trap(semaphore_signal_all_trap
, -34, 1)
110 kernel_trap(semaphore_signal_thread_trap
, -35, 2)
111 kernel_trap(semaphore_wait_trap
,-36,1)
112 kernel_trap(semaphore_wait_signal_trap
,-37,2)
113 kernel_trap(semaphore_timedwait_trap
,-38,3)
114 kernel_trap(semaphore_timedwait_signal_trap
,-39,4)
116 kernel_trap(_kernelrpc_mach_port_guard_trap
,-41,5)
117 kernel_trap(_kernelrpc_mach_port_unguard_trap
,-42,4)
119 kernel_trap(task_name_for_pid
,-44,3)
120 kernel_trap(task_for_pid
,-45,3)
121 kernel_trap(pid_for_task
,-46,2)
123 #if defined(__LP64__)
124 kernel_trap(macx_swapon
,-48, 4)
125 kernel_trap(macx_swapoff
,-49, 2)
127 kernel_trap(macx_swapon
,-48, 5)
128 kernel_trap(macx_swapoff
,-49, 3)
129 #endif /* __LP64__ */
130 kernel_trap(macx_triggers
,-51, 4)
131 kernel_trap(macx_backing_store_suspend
,-52, 1)
132 kernel_trap(macx_backing_store_recovery
,-53, 1)
134 /* These are currently used by pthreads even on LP64 */
135 /* But as soon as that is fixed - they will go away there */
136 kernel_trap(swtch_pri
,-59,1)
137 kernel_trap(swtch
,-60,0)
139 kernel_trap(syscall_thread_switch
,-61,3)
140 kernel_trap(clock_sleep_trap
,-62,5)
142 kernel_trap(mach_timebase_info
,-89,1)
144 #if defined(__LP64__)
145 /* unit64_t arguments passed in one register in LP64 */
146 kernel_trap(mach_wait_until
,-90,1)
148 kernel_trap(mach_wait_until
,-90,2)
149 #endif /* __LP64__ */
151 kernel_trap(mk_timer_create
,-91,0)
152 kernel_trap(mk_timer_destroy
,-92,1)
154 #if defined(__LP64__)
155 /* unit64_t arguments passed in one register in LP64 */
156 kernel_trap(mk_timer_arm
,-93,2)
158 kernel_trap(mk_timer_arm
,-93,3)
159 #endif /* __LP64__ */
161 kernel_trap(mk_timer_cancel
,-94,2)
164 * N.B: Trap #-100 is in use by IOTrap.s in the IOKit Framework
165 * (iokit_user_client_trap)
167 #endif /* _MACH_SYSCALL_SW_H_ */