···11+/*
22+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+/*
2929+ * @OSF_COPYRIGHT@
3030+ */
3131+/*
3232+ * Mach Operating System
3333+ * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
3434+ * All Rights Reserved.
3535+ *
3636+ * Permission to use, copy, modify and distribute this software and its
3737+ * documentation is hereby granted, provided that both the copyright
3838+ * notice and this permission notice appear in all copies of the
3939+ * software, derivative works or modified versions, and any portions
4040+ * thereof, and that both notices appear in supporting documentation.
4141+ *
4242+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545+ *
4646+ * Carnegie Mellon requests users of this software to return to
4747+ *
4848+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949+ * School of Computer Science
5050+ * Carnegie Mellon University
5151+ * Pittsburgh PA 15213-3890
5252+ *
5353+ * any improvements or extensions that they make and grant Carnegie Mellon
5454+ * the rights to redistribute these changes.
5555+ */
5656+5757+#ifdef PRIVATE
5858+5959+#ifndef _MACH_SYSCALL_SW_H_
6060+#define _MACH_SYSCALL_SW_H_
6161+6262+/*
6363+ * The machine-dependent "syscall_sw.h" file should
6464+ * define a macro for
6565+ * kernel_trap(trap_name, trap_number, arg_count)
6666+ * which will expand into assembly code for the
6767+ * trap.
6868+ *
6969+ * N.B.: When adding calls, do not put spaces in the macros.
7070+ */
7171+7272+#include <mach/machine/syscall_sw.h>
7373+7474+/*
7575+ * These trap numbers should be taken from the
7676+ * table in <kern/syscall_sw.c>.
7777+ */
7878+7979+/*
8080+ * i386 and x86_64 just load of the stack or use
8181+ * registers in order; no munging is required,
8282+ * and number of args is ignored. ARM loads args
8383+ * into registers beyond r3, unlike the normal
8484+ * procedure call standard; we pad for 64-bit args.
8585+ */
8686+kernel_trap(_kernelrpc_mach_vm_allocate_trap,-10,5) /* 4 args, +1 for mach_vm_size_t */
8787+kernel_trap(_kernelrpc_mach_vm_purgable_control_trap,-11,5) /* 4 args, +1 for mach_vm_offset_t */
8888+kernel_trap(_kernelrpc_mach_vm_deallocate_trap,-12,5) /* 3 args, +2 for mach_vm_size_t and mach_vm_address_t */
8989+kernel_trap(_kernelrpc_mach_vm_protect_trap,-14,7) /* 5 args, +2 for mach_vm_address_t and mach_vm_size_t */
9090+kernel_trap(_kernelrpc_mach_vm_map_trap,-15,9)
9191+kernel_trap(_kernelrpc_mach_port_allocate_trap,-16,3)
9292+kernel_trap(_kernelrpc_mach_port_destroy_trap,-17,2)
9393+kernel_trap(_kernelrpc_mach_port_deallocate_trap,-18,2)
9494+kernel_trap(_kernelrpc_mach_port_mod_refs_trap,-19,4)
9595+kernel_trap(_kernelrpc_mach_port_move_member_trap,-20,3)
9696+kernel_trap(_kernelrpc_mach_port_insert_right_trap,-21,4)
9797+kernel_trap(_kernelrpc_mach_port_insert_member_trap,-22,3)
9898+kernel_trap(_kernelrpc_mach_port_extract_member_trap,-23,3)
9999+kernel_trap(_kernelrpc_mach_port_construct_trap,-24,5)
100100+kernel_trap(_kernelrpc_mach_port_destruct_trap,-25,5)
101101+102102+kernel_trap(mach_reply_port,-26,0)
103103+kernel_trap(thread_self_trap,-27,0)
104104+kernel_trap(task_self_trap,-28,0)
105105+kernel_trap(host_self_trap,-29,0)
106106+107107+kernel_trap(mach_msg_trap,-31,7)
108108+kernel_trap(mach_msg_overwrite_trap,-32,9)
109109+kernel_trap(semaphore_signal_trap, -33, 1)
110110+kernel_trap(semaphore_signal_all_trap, -34, 1)
111111+kernel_trap(semaphore_signal_thread_trap, -35, 2)
112112+kernel_trap(semaphore_wait_trap,-36,1)
113113+kernel_trap(semaphore_wait_signal_trap,-37,2)
114114+kernel_trap(semaphore_timedwait_trap,-38,3)
115115+kernel_trap(semaphore_timedwait_signal_trap,-39,4)
116116+117117+kernel_trap(_kernelrpc_mach_port_guard_trap,-41,5)
118118+kernel_trap(_kernelrpc_mach_port_unguard_trap,-42,4)
119119+kernel_trap(mach_generate_activity_id, -43, 3)
120120+121121+kernel_trap(task_name_for_pid,-44,3)
122122+kernel_trap(task_for_pid,-45,3)
123123+kernel_trap(pid_for_task,-46,2)
124124+125125+#if defined(__LP64__)
126126+kernel_trap(macx_swapon,-48, 4)
127127+kernel_trap(macx_swapoff,-49, 2)
128128+#else /* __LP64__ */
129129+kernel_trap(macx_swapon,-48, 5)
130130+kernel_trap(macx_swapoff,-49, 3)
131131+#endif /* __LP64__ */
132132+kernel_trap(macx_triggers,-51, 4)
133133+kernel_trap(macx_backing_store_suspend,-52, 1)
134134+kernel_trap(macx_backing_store_recovery,-53, 1)
135135+136136+/* These are currently used by pthreads even on LP64 */
137137+/* But as soon as that is fixed - they will go away there */
138138+kernel_trap(swtch_pri,-59,1)
139139+kernel_trap(swtch,-60,0)
140140+141141+kernel_trap(syscall_thread_switch,-61,3)
142142+kernel_trap(clock_sleep_trap,-62,5)
143143+144144+/* voucher traps */
145145+kernel_trap(host_create_mach_voucher_trap,-70,4)
146146+/* mach_voucher_extract_attr_content */
147147+kernel_trap(mach_voucher_extract_attr_recipe_trap,-72,4)
148148+/* mach_voucher_extract_all_attr_recipes */
149149+/* mach_voucher_attr_command */
150150+/* mach_voucher_debug_info */
151151+152152+kernel_trap(mach_timebase_info_trap,-89,1)
153153+154154+#if defined(__LP64__)
155155+/* unit64_t arguments passed in one register in LP64 */
156156+kernel_trap(mach_wait_until,-90,1)
157157+#else /* __LP64__ */
158158+kernel_trap(mach_wait_until,-90,2)
159159+#endif /* __LP64__ */
160160+161161+kernel_trap(mk_timer_create,-91,0)
162162+kernel_trap(mk_timer_destroy,-92,1)
163163+164164+#if defined(__LP64__)
165165+/* unit64_t arguments passed in one register in LP64 */
166166+kernel_trap(mk_timer_arm,-93,2)
167167+#else /* __LP64__ */
168168+kernel_trap(mk_timer_arm,-93,3)
169169+#endif /* __LP64__ */
170170+171171+kernel_trap(mk_timer_cancel,-94,2)
172172+173173+/*
174174+ * N.B: Trap #-100 is in use by IOTrap.s in the IOKit Framework
175175+ * (iokit_user_client_trap)
176176+ */
177177+#endif /* _MACH_SYSCALL_SW_H_ */
178178+179179+#endif /* PRIVATE */