1 /* $NetBSD: mach_misc.c,v 1.27 2007/12/22 17:49:32 christos Exp $ */
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 * MACH compatibility module.
35 * We actually don't implement anything here yet!
38 #include <sys/cdefs.h>
39 __KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.27 2007/12/22 17:49:32 christos Exp $");
41 #include <sys/param.h>
42 #include <sys/systm.h>
43 #include <sys/namei.h>
44 #include <sys/dirent.h>
49 #include <sys/filedesc.h>
50 #include <sys/ioctl.h>
51 #include <sys/kernel.h>
52 #include <sys/malloc.h>
56 #include <sys/mount.h>
57 #include <sys/resource.h>
58 #include <sys/resourcevar.h>
59 #include <sys/socket.h>
60 #include <sys/vnode.h>
63 #include <sys/utsname.h>
64 #include <sys/unistd.h>
65 #include <sys/times.h>
68 #include <sys/ptrace.h>
69 #include <sys/signalvar.h>
71 #include <netinet/in.h>
72 #include <sys/syscallargs.h>
74 #include <miscfs/specfs/specdev.h>
76 #include <compat/mach/mach_types.h>
77 #include <compat/mach/mach_message.h>
78 #include <compat/mach/mach_clock.h>
79 #include <compat/mach/mach_syscallargs.h>
83 mach_sys_semaphore_timedwait_trap(struct lwp
*l
, const struct mach_sys_semaphore_timedwait_trap_args
*uap
, register_t
*retval
)
87 DPRINTF(("mach_sys_semaphore_timedwait_trap(0x%x, %d, %d);\n",
88 SCARG(uap
, wait_name
), SCARG(uap
, sec
), SCARG(uap
, nsec
)));
94 mach_sys_semaphore_timedwait_signal_trap(struct lwp
*l
, const struct mach_sys_semaphore_timedwait_signal_trap_args
*uap
, register_t
*retval
)
99 "mach_sys_semaphore_timedwait_signal_trap(0x%x, 0x%x, %d, %d);\n",
100 SCARG(uap
, wait_name
), SCARG(uap
, signal_name
), SCARG(uap
, sec
),
107 mach_sys_init_process(struct lwp
*l
, const void *v
, register_t
*retval
)
110 DPRINTF(("mach_sys_init_process();\n"));
116 mach_sys_pid_for_task(struct lwp
*l
, const struct mach_sys_pid_for_task_args
*uap
, register_t
*retval
)
120 DPRINTF(("mach_sys_pid_for_task(0x%x, %p);\n",
121 SCARG(uap
, t
), SCARG(uap
, x
)));
127 mach_sys_macx_swapon(struct lwp
*l
, const struct mach_sys_macx_swapon_args
*uap
, register_t
*retval
)
131 DPRINTF(("mach_sys_macx_swapon(%p, %d, %d, %d);\n",
132 SCARG(uap
, name
), SCARG(uap
, flags
), SCARG(uap
, size
),
133 SCARG(uap
, priority
)));
138 mach_sys_macx_swapoff(struct lwp
*l
, const struct mach_sys_macx_swapoff_args
*uap
, register_t
*retval
)
142 DPRINTF(("mach_sys_macx_swapoff(%p, %d);\n",
143 SCARG(uap
, name
), SCARG(uap
, flags
)));
148 mach_sys_macx_triggers(struct lwp
*l
, const struct mach_sys_macx_triggers_args
*uap
, register_t
*retval
)
152 DPRINTF(("mach_sys_macx_triggers(%d, %d, %d, 0x%x);\n",
153 SCARG(uap
, hi_water
), SCARG(uap
, low_water
), SCARG(uap
, flags
),
154 SCARG(uap
, alert_port
)));
160 mach_sys_wait_until(struct lwp
*l
, const struct mach_sys_wait_until_args
*uap
, register_t
*retval
)
164 DPRINTF(("mach_sys_wait_until(%lld);\n",
165 SCARG(uap
, deadline
)));
171 mach_sys_timer_create(struct lwp
*l
, const void *v
, register_t
*retval
)
174 DPRINTF(("mach_sys_timer_create();\n"));
180 mach_sys_timer_destroy(struct lwp
*l
, const struct mach_sys_timer_destroy_args
*uap
, register_t
*retval
)
184 DPRINTF(("mach_sys_timer_destroy(0x%x);\n", SCARG(uap
, name
)));
190 mach_sys_timer_arm(struct lwp
*l
, const struct mach_sys_timer_arm_args
*uap
, register_t
*retval
)
194 DPRINTF(("mach_sys_timer_arm(0x%x, %d);\n",
195 SCARG(uap
, name
), SCARG(uap
, expire_time
)));
201 mach_sys_timer_cancel(struct lwp
*l
, const struct mach_sys_timer_cancel_args
*uap
, register_t
*retval
)
205 DPRINTF(("mach_sys_timer_cancel(0x%x, %p);\n",
206 SCARG(uap
, name
), SCARG(uap
, result_time
)));
212 mach_sys_get_time_base_info(struct lwp
*l
, const void *v
, register_t
*retval
)
215 DPRINTF(("mach_sys_get_time_base_info();\n"));