Handling more darwin-user syscalls, by Ilya Shar.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2502 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-03-19 13:43:04 +00:00
parent b5906f9589
commit ee999a8899
2 changed files with 34 additions and 4 deletions

View file

@ -53,6 +53,8 @@
#include <mach/ndr.h>
#include <mach/mig_errors.h>
#include <sys/xattr.h>
#include "qemu.h"
//#define DEBUG_SYSCALL
@ -451,21 +453,49 @@ long do_mach_syscall(void *cpu_env, int num, uint32_t arg1, uint32_t arg2, uint3
case -31:
DPRINTF("mach_msg_trap(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n",
arg1, arg2, arg3, arg4, arg5, arg6, arg7);
ret = target_mach_msg_trap((mach_msg_header_t *)arg1, arg2, arg3, arg4, arg5, arg6, arg7);
break;
/* may need more translation if target arch is different from host */
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
case -33:
DPRINTF("semaphore_signal_trap(0x%x)\n", arg1);
ret = semaphore_signal_trap(arg1);
break;
case -34:
DPRINTF("semaphore_signal_all_trap(0x%x)\n", arg1);
ret = semaphore_signal_all_trap(arg1);
break;
case -35:
DPRINTF("semaphore_signal_thread_trap(0x%x)\n", arg1, arg2);
ret = semaphore_signal_thread_trap(arg1,arg2);
break;
#endif
case -36:
DPRINTF("semaphore_wait_trap(0x%x)\n", arg1);
extern int semaphore_wait_trap(int); // XXX: is there any header for that?
ret = semaphore_wait_trap(arg1);
break;
/* may need more translation if target arch is different from host */
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
case -37:
DPRINTF("semaphore_wait_signal_trap(0x%x, 0x%x)\n", arg1, arg2);
ret = semaphore_wait_signal_trap(arg1,arg2);
break;
#endif
case -43:
DPRINTF("map_fd(0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n",
arg1, arg2, arg3, arg4, arg5);
ret = map_fd(arg1, arg2, (void*)arg3, arg4, arg5);
tswap32s((uint32_t*)arg3);
break;
/* may need more translation if target arch is different from host */
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
case -61:
DPRINTF("syscall_thread_switch(0x%x, 0x%x, 0x%x)\n",
arg1, arg2, arg3);
ret = syscall_thread_switch(arg1, arg2, arg3); // just a hint to the scheduler; can drop?
break;
#endif
case -89:
DPRINTF("mach_timebase_info(0x%x)\n", arg1);
struct mach_timebase_info info;

View file

@ -42,7 +42,7 @@
ENTRY("getppid", SYS_getppid, getppid, 0, CALL_DIRECT, VOID) /* 39 */
ENTRY("", 40, no_syscall, 0, CALL_INDIRECT, VOID) /* 40 old lstat */
ENTRY("dup", SYS_dup, dup, 1, CALL_DIRECT, INT) /* 41 */
ENTRY("pipe", SYS_pipe, unimpl_unix_syscall, 0, CALL_INDIRECT, PTR) /* 42 */
ENTRY("pipe", SYS_pipe, pipe, 0, CALL_INDIRECT, PTR) /* 42 */
ENTRY("getegid", SYS_getegid, getegid, 0, CALL_NOERRNO, VOID) /* 43 */
ENTRY("profil", SYS_profil, profil, 4, CALL_DIRECT, PTR, SIZE, INT, INT) /* 44 */
ENTRY("ktrace", SYS_ktrace, no_syscall, 4, CALL_INDIRECT, VOID) /* 45 */
@ -247,7 +247,7 @@
ENTRY("fsetxattr", SYS_fsetxattr, no_syscall, 6, CALL_INDIRECT, VOID) /* 237 */
ENTRY("removexattr", SYS_removexattr, no_syscall, 3, CALL_INDIRECT, VOID) /* 238 */
ENTRY("fremovexattr", SYS_fremovexattr, no_syscall, 3, CALL_INDIRECT, VOID) /* 239 */
ENTRY("listxattr", SYS_listxattr, no_syscall, 4, CALL_INDIRECT, VOID) /* 240 */
ENTRY("listxattr", SYS_listxattr, listxattr, 4, CALL_INDIRECT, VOID) /* 240 */
ENTRY("flistxattr", SYS_flistxattr, no_syscall, 4, CALL_INDIRECT, VOID) /* 241 */
ENTRY("fsctl", SYS_fsctl, fsctl, 4, CALL_DIRECT, PTR, UINT, PTR, UINT) /* 242 */
ENTRY("initgroups", SYS_initgroups, unimpl_unix_syscall, 3, CALL_INDIRECT, UINT, PTR, INT) /* 243 */