From bab8693bba4f179653e8707957dc59ef3e0973ce Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 26 Dec 2002 14:41:05 +0000 Subject: [PATCH] Added the mysterious system call 331 (it does not seems to be in the header files anywhere). This is pthread_exit. --- sys/compat/darwin/darwin_syscall.h | 7 +++++-- sys/compat/darwin/darwin_syscallargs.h | 9 +++++++-- sys/compat/darwin/darwin_syscalls.c | 8 ++++---- sys/compat/darwin/darwin_sysent.c | 10 +++++----- sys/compat/darwin/darwin_thread.c | 22 ++++++++++++++++++++-- sys/compat/darwin/syscalls.master | 4 ++-- 6 files changed, 43 insertions(+), 17 deletions(-) diff --git a/sys/compat/darwin/darwin_syscall.h b/sys/compat/darwin/darwin_syscall.h index b3969a2866f6..7a9847e82d10 100644 --- a/sys/compat/darwin/darwin_syscall.h +++ b/sys/compat/darwin/darwin_syscall.h @@ -1,10 +1,10 @@ -/* $NetBSD: darwin_syscall.h,v 1.15 2002/12/24 12:15:45 manu Exp $ */ +/* $NetBSD: darwin_syscall.h,v 1.16 2002/12/26 14:41:05 manu Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.8 2002/12/08 21:53:18 manu Exp + * created from NetBSD: syscalls.master,v 1.9 2002/12/24 12:15:46 manu Exp */ /* syscall: "syscall" ret: "int" args: "int" "..." */ @@ -402,5 +402,8 @@ /* syscall: "load_shared_file" ret: "int" args: "char *" "caddr_t" "u_long" "caddr_t *" "int" "mach_sf_mapping_t *" "int *" */ #define DARWIN_SYS_load_shared_file 296 +/* syscall: "pthread_exit" ret: "void" args: "void *" */ +#define DARWIN_SYS_pthread_exit 331 + #define DARWIN_SYS_MAXSYSCALL 350 #define DARWIN_SYS_NSYSENT 512 diff --git a/sys/compat/darwin/darwin_syscallargs.h b/sys/compat/darwin/darwin_syscallargs.h index 104f13d694a9..1191f72b246e 100644 --- a/sys/compat/darwin/darwin_syscallargs.h +++ b/sys/compat/darwin/darwin_syscallargs.h @@ -1,10 +1,10 @@ -/* $NetBSD: darwin_syscallargs.h,v 1.15 2002/12/24 12:15:45 manu Exp $ */ +/* $NetBSD: darwin_syscallargs.h,v 1.16 2002/12/26 14:41:05 manu Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.8 2002/12/08 21:53:18 manu Exp + * created from NetBSD: syscalls.master,v 1.9 2002/12/24 12:15:46 manu Exp */ #ifndef _DARWIN_SYS__SYSCALLARGS_H_ @@ -226,6 +226,10 @@ struct darwin_sys_load_shared_file_args { syscallarg(int *) flags; }; +struct darwin_sys_pthread_exit_args { + syscallarg(void *) value_ptr; +}; + /* * System call prototypes. */ @@ -409,4 +413,5 @@ int sys_mlock(struct proc *, void *, register_t *); int sys_munlock(struct proc *, void *, register_t *); int bsd_sys_undelete(struct proc *, void *, register_t *); int darwin_sys_load_shared_file(struct proc *, void *, register_t *); +int darwin_sys_pthread_exit(struct proc *, void *, register_t *); #endif /* _DARWIN_SYS__SYSCALLARGS_H_ */ diff --git a/sys/compat/darwin/darwin_syscalls.c b/sys/compat/darwin/darwin_syscalls.c index c1c7eba920b1..cbeccc87935b 100644 --- a/sys/compat/darwin/darwin_syscalls.c +++ b/sys/compat/darwin/darwin_syscalls.c @@ -1,14 +1,14 @@ -/* $NetBSD: darwin_syscalls.c,v 1.15 2002/12/24 12:15:46 manu Exp $ */ +/* $NetBSD: darwin_syscalls.c,v 1.16 2002/12/26 14:41:05 manu Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.8 2002/12/08 21:53:18 manu Exp + * created from NetBSD: syscalls.master,v 1.9 2002/12/24 12:15:46 manu Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.15 2002/12/24 12:15:46 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.16 2002/12/26 14:41:05 manu Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -383,7 +383,7 @@ const char *const darwin_syscallnames[] = { "#328 (unimplemented __pthread_kill)", /* 328 = unimplemented __pthread_kill */ "#329 (unimplemented pthread_sigmask)", /* 329 = unimplemented pthread_sigmask */ "#330 (unimplemented sigwait)", /* 330 = unimplemented sigwait */ - "#331 (unimplemented)", /* 331 = unimplemented */ + "pthread_exit", /* 331 = pthread_exit */ "#332 (unimplemented)", /* 332 = unimplemented */ "#333 (unimplemented)", /* 333 = unimplemented */ "#334 (unimplemented)", /* 334 = unimplemented */ diff --git a/sys/compat/darwin/darwin_sysent.c b/sys/compat/darwin/darwin_sysent.c index 1e14f5f1d648..f05501301de5 100644 --- a/sys/compat/darwin/darwin_sysent.c +++ b/sys/compat/darwin/darwin_sysent.c @@ -1,14 +1,14 @@ -/* $NetBSD: darwin_sysent.c,v 1.15 2002/12/24 12:15:46 manu Exp $ */ +/* $NetBSD: darwin_sysent.c,v 1.16 2002/12/26 14:41:05 manu Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.8 2002/12/08 21:53:18 manu Exp + * created from NetBSD: syscalls.master,v 1.9 2002/12/24 12:15:46 manu Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.15 2002/12/24 12:15:46 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.16 2002/12/26 14:41:05 manu Exp $"); #include "opt_ktrace.h" #include "opt_nfsserver.h" @@ -719,8 +719,8 @@ struct sysent darwin_sysent[] = { sys_nosys }, /* 329 = unimplemented pthread_sigmask */ { 0, 0, 0, sys_nosys }, /* 330 = unimplemented sigwait */ - { 0, 0, 0, - sys_nosys }, /* 331 = unimplemented */ + { 1, s(struct darwin_sys_pthread_exit_args), 0, + darwin_sys_pthread_exit }, /* 331 = pthread_exit */ { 0, 0, 0, sys_nosys }, /* 332 = unimplemented */ { 0, 0, 0, diff --git a/sys/compat/darwin/darwin_thread.c b/sys/compat/darwin/darwin_thread.c index 0d386eb74ea0..4e5df5a09024 100644 --- a/sys/compat/darwin/darwin_thread.c +++ b/sys/compat/darwin/darwin_thread.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_thread.c,v 1.1 2002/12/08 21:53:18 manu Exp $ */ +/* $NetBSD: darwin_thread.c,v 1.2 2002/12/26 14:41:06 manu Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: darwin_thread.c,v 1.1 2002/12/08 21:53:18 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_thread.c,v 1.2 2002/12/26 14:41:06 manu Exp $"); #include #include @@ -90,3 +90,21 @@ darwin_sys_vfork(p, v, retval) return 0; } + +int +darwin_sys_pthread_exit(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ +#ifdef notyet + struct darwin_sys_pthread_exit_args /* { + syscallarg(void *) value_ptr; + } */ *uap = v; +#endif + /* + * This is called on thread termination. We should make value_ptr + * available to other threads doing a join operation. + */ + return 0; +} diff --git a/sys/compat/darwin/syscalls.master b/sys/compat/darwin/syscalls.master index 72b872b4704e..093510094493 100644 --- a/sys/compat/darwin/syscalls.master +++ b/sys/compat/darwin/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.9 2002/12/24 12:15:46 manu Exp $ + $NetBSD: syscalls.master,v 1.10 2002/12/26 14:41:06 manu Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -515,7 +515,7 @@ 328 UNIMPL __pthread_kill 329 UNIMPL pthread_sigmask 330 UNIMPL sigwait -331 UNIMPL +331 STD { void darwin_sys_pthread_exit(void *value_ptr); } 332 UNIMPL 333 UNIMPL 334 UNIMPL